Skip to content

Commit 75261f5

Browse files
committed
archiver: tests: amend test to include WaitForCompletion()
This is a trivial one, so go ahead and include it.
1 parent ee6f508 commit 75261f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

services/archiver/archiver_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,15 @@ func TestArchive_Basic(t *testing.T) {
184184
assert.Equal(t, 2, len(archiveInProgress))
185185
releaseOneEntry(t, inFlight)
186186
assert.Equal(t, 1, len(archiveInProgress))
187+
188+
// Test waiting for completion on one, which should be relatively
189+
// straightforward. We'll hold the queue-lock and release an entry. It will
190+
// wait to acquire the queue lock, which we'll drop when we
191+
// WaitForCompletion(), to be woken up later.
192+
LockQueue()
187193
releaseOneEntry(t, inFlight)
194+
WaitForCompletion()
195+
UnlockQueue()
188196
assert.Equal(t, 0, len(archiveInProgress))
189197

190198
zipReq2 = DeriveRequestFrom(ctx, firstCommit+".zip")

0 commit comments

Comments
 (0)