Merge pull request #1912 from clnperez/threshold-test

check for threshold, not range
This commit is contained in:
Michael Crosby 2017-12-14 14:53:45 -05:00 committed by GitHub
commit 10ef7f37c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ import (
) )
func TestPauseThreshold(t *testing.T) { func TestPauseThreshold(t *testing.T) {
cfg := &config{ cfg := &config{
// With 100μs, gc should run about every 5ms // With 100μs, gc should run about every 5ms
PauseThreshold: 0.02, PauseThreshold: 0.02,
@ -39,8 +40,9 @@ func TestPauseThreshold(t *testing.T) {
}() }()
time.Sleep(time.Millisecond * 15) 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)
} }
} }