diff options
| author | Jonathan Amsterdam <jba@google.com> | 2021-06-11 10:15:57 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2021-06-11 18:04:46 +0000 |
| commit | 1c1eedc50b671114ea445f5b95edb250064bdbbb (patch) | |
| tree | 834ef1d9b82aab7183666bc3f93aae3dfc308417 /internal/testing | |
| parent | a973529477fa73b703014db727a0ab425b917d40 (diff) | |
| download | go-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.go | 5 |
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) } } |
