mirror of https://github.com/status-im/consul.git
Merge pull request #8548 from edevil/fix_flake
Fix flaky TestACLResolver_Client/Concurrent-Token-Resolve
This commit is contained in:
commit
6956477be5
|
@ -60,7 +60,7 @@ func TestCacheNotifyChResult(t testing.T, ch <-chan UpdateEvent, expected ...Upd
|
||||||
}
|
}
|
||||||
|
|
||||||
got := make([]UpdateEvent, 0, expectLen)
|
got := make([]UpdateEvent, 0, expectLen)
|
||||||
timeoutCh := time.After(50 * time.Millisecond)
|
timeoutCh := time.After(75 * time.Millisecond)
|
||||||
|
|
||||||
OUT:
|
OUT:
|
||||||
for {
|
for {
|
||||||
|
@ -74,7 +74,7 @@ OUT:
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-timeoutCh:
|
case <-timeoutCh:
|
||||||
t.Fatalf("got %d results on chan in 50ms, want %d", len(got), expectLen)
|
t.Fatalf("timeout while waiting for result: got %d results on chan, want %d", len(got), expectLen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ func TestCacheNotifyPolling(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
require.Equal(events[0].Result, 42)
|
require.Equal(events[0].Result, 42)
|
||||||
require.Equal(events[0].Meta.Hit, false)
|
require.Equal(events[0].Meta.Hit && events[1].Meta.Hit, false)
|
||||||
require.Equal(events[0].Meta.Index, uint64(1))
|
require.Equal(events[0].Meta.Index, uint64(1))
|
||||||
require.True(events[0].Meta.Age < 50*time.Millisecond)
|
require.True(events[0].Meta.Age < 50*time.Millisecond)
|
||||||
require.NoError(events[0].Err)
|
require.NoError(events[0].Err)
|
||||||
|
|
|
@ -1639,8 +1639,8 @@ func TestACLResolver_Client(t *testing.T) {
|
||||||
// effectively disable caching - so the only way we end up with 1 token read is if they were
|
// effectively disable caching - so the only way we end up with 1 token read is if they were
|
||||||
// being resolved concurrently
|
// being resolved concurrently
|
||||||
config.Config.ACLTokenTTL = 0 * time.Second
|
config.Config.ACLTokenTTL = 0 * time.Second
|
||||||
config.Config.ACLPolicyTTL = 30 * time.Millisecond
|
config.Config.ACLPolicyTTL = 30 * time.Second
|
||||||
config.Config.ACLRoleTTL = 30 * time.Millisecond
|
config.Config.ACLRoleTTL = 30 * time.Second
|
||||||
config.Config.ACLDownPolicy = "extend-cache"
|
config.Config.ACLDownPolicy = "extend-cache"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue