Skip to content

Commit

Permalink
Increase timeout for this (flaky?) test
Browse files Browse the repository at this point in the history
  • Loading branch information
ismith committed Nov 2, 2021
1 parent ac3778e commit 3b409a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions collect/collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,14 @@ func TestCacheSizeReload(t *testing.T) {
coll.AddSpan(&types.Span{TraceID: "2", Event: event})

expectedEvents := 1
wait := 2 * time.Millisecond
wait := 1 * time.Second
check := func() bool {
transmission.Mux.RLock()
defer transmission.Mux.RUnlock()

return len(transmission.Events) == expectedEvents
}
assert.Eventually(t, check, 10*wait, wait, "expected one trace evicted and sent")
assert.Eventually(t, check, 60*wait, wait, "expected one trace evicted and sent")

conf.Mux.Lock()
conf.GetInMemoryCollectorCacheCapacityVal.CacheCapacity = 2
Expand All @@ -339,7 +339,7 @@ func TestCacheSizeReload(t *testing.T) {
defer coll.mutex.RUnlock()

return coll.cache.(*cache.DefaultInMemCache).GetCacheSize() == 2
}, 10*wait, wait, "cache size to change")
}, 60*wait, wait, "cache size to change")

coll.AddSpan(&types.Span{TraceID: "3", Event: event})
time.Sleep(5 * conf.SendTickerVal)
Expand All @@ -351,7 +351,7 @@ func TestCacheSizeReload(t *testing.T) {
conf.ReloadConfig()

expectedEvents = 2
assert.Eventually(t, check, 10*wait, wait, "expected another trace evicted and sent")
assert.Eventually(t, check, 60*wait, wait, "expected another trace evicted and sent")
}

func TestSampleConfigReload(t *testing.T) {
Expand All @@ -361,7 +361,7 @@ func TestSampleConfigReload(t *testing.T) {

conf := &config.MockConfig{
GetSendDelayVal: 0,
GetTraceTimeoutVal: 10 * time.Millisecond,
GetTraceTimeoutVal: 60 * time.Second,
GetSamplerTypeVal: &config.DeterministicSamplerConfig{SampleRate: 1},
SendTickerVal: 2 * time.Millisecond,
GetInMemoryCollectorCacheCapacityVal: config.InMemoryCollectorCacheCapacity{CacheCapacity: 10},
Expand Down

0 comments on commit 3b409a2

Please sign in to comment.