From f6a19e1d4ddec85e2aee2e6968794d1b742a7e17 Mon Sep 17 00:00:00 2001 From: Krzysztof Kiewicz Date: Wed, 8 May 2024 18:56:21 +0200 Subject: [PATCH] Fix test flakiness - bump timeouts --- quesma/quesma/field_caps_test.go | 2 -- quesma/quesma/search_test.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/quesma/quesma/field_caps_test.go b/quesma/quesma/field_caps_test.go index f47706b6b..ad6ca835e 100644 --- a/quesma/quesma/field_caps_test.go +++ b/quesma/quesma/field_caps_test.go @@ -2,7 +2,6 @@ package quesma import ( "encoding/json" - "fmt" "github.com/stretchr/testify/assert" "mitmproxy/quesma/clickhouse" "mitmproxy/quesma/concurrent" @@ -190,7 +189,6 @@ func TestFieldCapsMultipleIndexesConflictingEntries(t *testing.T) { }, }) resp, err := handleFieldCapsIndex(ctx, []string{"logs-1", "logs-2", "logs-3"}, *tableMap) - fmt.Printf("string(resp): %+v\n", string(resp)) assert.NoError(t, err) expectedResp, err := json.MarshalIndent([]byte(`{ "fields": { diff --git a/quesma/quesma/search_test.go b/quesma/quesma/search_test.go index 300b9c2ac..8fe625eab 100644 --- a/quesma/quesma/search_test.go +++ b/quesma/quesma/search_test.go @@ -437,7 +437,7 @@ func TestAllUnsupportedQueryTypesAreProperlyRecorded(t *testing.T) { // (go managementConsole.RunOnlyChannelProcessor() above), so we might need to wait a bit assert.Eventually(t, func() bool { return len(managementConsole.QueriesWithUnsupportedType(tt.QueryType)) == 1 - }, 150*time.Millisecond, 1*time.Millisecond) + }, 250*time.Millisecond, 1*time.Millisecond) assert.Equal(t, 1, managementConsole.GetTotalUnsupportedQueries()) assert.Equal(t, 1, managementConsole.GetSavedUnsupportedQueries()) assert.Equal(t, 1, len(managementConsole.GetUnsupportedTypesWithCount())) @@ -489,7 +489,7 @@ func TestDifferentUnsupportedQueries(t *testing.T) { // (go managementConsole.RunOnlyChannelProcessor() above), so we might need to wait a bit assert.Eventually(t, func() bool { return len(managementConsole.QueriesWithUnsupportedType(tt.QueryType)) == min(testCounts[i], maxSavedQueriesPerQueryType) - }, 500*time.Millisecond, 1*time.Millisecond, + }, 600*time.Millisecond, 1*time.Millisecond, tt.TestName+": wanted: %d, got: %d", min(testCounts[i], maxSavedQueriesPerQueryType), len(managementConsole.QueriesWithUnsupportedType(tt.QueryType)), )