Merge pull request #1912 from clnperez/threshold-test
check for threshold, not range
This commit is contained in:
commit
10ef7f37c7
@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func TestPauseThreshold(t *testing.T) {
|
||||
|
||||
cfg := &config{
|
||||
// With 100μs, gc should run about every 5ms
|
||||
PauseThreshold: 0.02,
|
||||
@ -39,8 +40,9 @@ func TestPauseThreshold(t *testing.T) {
|
||||
}()
|
||||
|
||||
time.Sleep(time.Millisecond * 15)
|
||||
if c := tc.runCount(); c < 3 || c > 4 {
|
||||
t.Fatalf("unexpected gc run count %d, expected between 5 and 6", c)
|
||||
|
||||
if c := tc.runCount(); c > 4 {
|
||||
t.Fatalf("unexpected gc run count %d, expected less than 5", c)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user