Skip to content

Commit

Permalink
fix race in test
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Nov 20, 2023
1 parent 83ed0e8 commit e855196
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions broker_memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ func TestMemoryBrokerResultCacheExpires(t *testing.T) {
})
require.NoError(t, err)

e.resultCacheMu.Lock()
require.Len(t, e.resultCache, 1)
e.resultCacheMu.Unlock()
time.Sleep(2 * time.Second)
e.resultCacheMu.Lock()
require.Len(t, e.resultCache, 0)
e.resultCacheMu.Unlock()
}

func TestMemoryBrokerPublishIdempotent(t *testing.T) {
Expand Down

0 comments on commit e855196

Please sign in to comment.