add check if it runs on CI

pull/1068/head
shirou 4 years ago
parent c6bd05a3e9
commit 3d97fc18f4

@ -89,8 +89,12 @@ func TestNetIOCountersAll(t *testing.T) {
}
// small diff is ok
if math.Abs(float64(v[0].PacketsRecv-pr)) > 5 {
// This test often fails in CI. so just print even if failed
if ci := os.Getenv("CI"); ci != "" {
// This test often fails in CI. so just print even if failed.
fmt.Printf("invalid sum value: %v, %v", v[0].PacketsRecv, pr)
} else {
t.Errorf("invalid sum value: %v, %v", v[0].PacketsRecv, pr)
}
}
}

@ -89,8 +89,12 @@ func TestNetIOCountersAll(t *testing.T) {
}
// small diff is ok
if math.Abs(float64(v[0].PacketsRecv-pr)) > 5 {
// This test often fails in CI. so just print even if failed
if ci := os.Getenv("CI"); ci != "" {
// This test often fails in CI. so just print even if failed.
fmt.Printf("invalid sum value: %v, %v", v[0].PacketsRecv, pr)
} else {
t.Errorf("invalid sum value: %v, %v", v[0].PacketsRecv, pr)
}
}
}

Loading…
Cancel
Save