From 75261f56bc05d1fa8ff7e81dcbc0ccd93fdc9d50 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 7 May 2020 18:38:47 -0500 Subject: [PATCH] archiver: tests: amend test to include WaitForCompletion() This is a trivial one, so go ahead and include it. --- services/archiver/archiver_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/archiver/archiver_test.go b/services/archiver/archiver_test.go index 61f9e72958..54ea6f1f1f 100644 --- a/services/archiver/archiver_test.go +++ b/services/archiver/archiver_test.go @@ -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")