aboutsummaryrefslogtreecommitdiff
path: root/internal/testing
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-06-11 10:15:57 -0400
committerJonathan Amsterdam <jba@google.com>2021-06-11 18:04:46 +0000
commit1c1eedc50b671114ea445f5b95edb250064bdbbb (patch)
tree834ef1d9b82aab7183666bc3f93aae3dfc308417 /internal/testing
parenta973529477fa73b703014db727a0ab425b917d40 (diff)
downloadgo-x-pkgsite-1c1eedc50b671114ea445f5b95edb250064bdbbb.tar.xz
internal/queue: fix race condition
InMemory.WaitForTesting was waiting for the set of workers to be empty, but that's not quite the same as the queue being empty: all the workers can finish momentarily before a new one starts up. Wait for the queue itself to be empty. Change-Id: Icf0e970fdb2f45aa30c358c9d4af1083442a0293 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/327109 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/testing')
-rw-r--r--internal/testing/integration/integration_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/testing/integration/integration_test.go b/internal/testing/integration/integration_test.go
index 8c0a98df..ddf8738a 100644
--- a/internal/testing/integration/integration_test.go
+++ b/internal/testing/integration/integration_test.go
@@ -119,8 +119,11 @@ func TestEndToEndProcessing(t *testing.T) {
}
}
keys = cacheKeys(t, redisCacheClient)
+ if len(keys) == 0 {
+ keys = nil
+ }
if !cmp.Equal(keys, wantKeys) {
- t.Errorf("cache keys: got %v, want %v", keys, wantKeys)
+ t.Errorf("cache keys: got %+v, want %+v", keys, wantKeys)
}
}