Skip to content

Commit

Permalink
clean up test
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jun 20, 2024
1 parent ac6177c commit 5630f53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions common/configuration/asm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func localstack(ctx context.Context, t *testing.T) (*ASM, *asmLeader) {
return asm, leader
}

func waitForCacheToProcessUpdates(l *asmLeader) { // nolint:unused
func waitForUpdatesToProcess(l *asmLeader) {
l.topicWaitGroup.Wait()
}

Expand All @@ -60,7 +60,7 @@ func TestASMWorkflow(t *testing.T) {
assert.Equal(t, items, []Entry{})

err = manager.Set(ctx, "asm", ref, mySecret)
waitForCacheToProcessUpdates(leader)
waitForUpdatesToProcess(leader)
assert.NoError(t, err)

items, err = manager.List(ctx)
Expand All @@ -73,15 +73,15 @@ func TestASMWorkflow(t *testing.T) {
// Set again to make sure it updates.
mySecret = []byte("hunter1")
err = manager.Set(ctx, "asm", ref, mySecret)
waitForCacheToProcessUpdates(leader)
waitForUpdatesToProcess(leader)
assert.NoError(t, err)

err = manager.Get(ctx, ref, &gotSecret)
assert.NoError(t, err)
assert.Equal(t, gotSecret, mySecret)

err = manager.Unset(ctx, "asm", ref)
waitForCacheToProcessUpdates(leader)
waitForUpdatesToProcess(leader)
assert.NoError(t, err)

items, err = manager.List(ctx)
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestASMPagination(t *testing.T) {
err := manager.Unset(ctx, "asm", ref)
assert.NoError(t, err)
}
waitForCacheToProcessUpdates(leader)
waitForUpdatesToProcess(leader)

// Make sure they are all gone
items, err = manager.List(ctx)
Expand Down

0 comments on commit 5630f53

Please sign in to comment.