Skip to content

Commit

Permalink
archiver: tests: amend test to include WaitForCompletion()
Browse files Browse the repository at this point in the history
This is a trivial one, so go ahead and include it.
  • Loading branch information
kevans91 committed May 7, 2020
1 parent ee6f508 commit 75261f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions services/archiver/archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ func TestArchive_Basic(t *testing.T) {
assert.Equal(t, 2, len(archiveInProgress))
releaseOneEntry(t, inFlight)
assert.Equal(t, 1, len(archiveInProgress))

// Test waiting for completion on one, which should be relatively
// straightforward. We'll hold the queue-lock and release an entry. It will
// wait to acquire the queue lock, which we'll drop when we
// WaitForCompletion(), to be woken up later.
LockQueue()
releaseOneEntry(t, inFlight)
WaitForCompletion()
UnlockQueue()
assert.Equal(t, 0, len(archiveInProgress))

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

0 comments on commit 75261f5

Please sign in to comment.