Be more conservative for Windows in TestFrequency for Splunk

Signed-off-by: Deep Debroy <ddebroy@docker.com>
(cherry picked from commit a5c420ac54)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Deep Debroy 2019-07-17 13:13:50 -07:00 committed by Sebastiaan van Stijn
parent bf212c5b33
commit 7e76438537
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -925,7 +925,12 @@ func TestFrequency(t *testing.T) {
// 1 to verify connection and 10 to verify that we have sent messages with required frequency,
// but because frequency is too small (to keep test quick), instead of 11, use 9 if context switches will be slow
if hec.numOfRequests < 9 {
expectedRequests := 9
if runtime.GOOS == "windows" {
// sometimes in Windows, this test fails with number of requests showing 8. So be more conservative.
expectedRequests = 7
}
if hec.numOfRequests < expectedRequests {
t.Fatalf("Unexpected number of requests %d", hec.numOfRequests)
}