From 414af00ede21019cf9be9f5b141050bf6270f0fc Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sat, 19 Mar 2022 13:25:18 +0100 Subject: [PATCH] Increase sniffer timeout in tests --- bulk_processor_test.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/bulk_processor_test.go b/bulk_processor_test.go index 4702770e..63c471e0 100644 --- a/bulk_processor_test.go +++ b/bulk_processor_test.go @@ -9,19 +9,13 @@ import ( "fmt" "math/rand" "reflect" - "runtime" "sync/atomic" "testing" "time" ) func TestBulkProcessorDefaults(t *testing.T) { - // TODO This test is flaky on Go 1.18. I have no idea why. All other tests work. - if runtime.Version() == "go1.18" { - t.Skipf("This test is flaky on Go 1.18. I have no idea why. All other tests work.") - } - - client := setupTestClientAndCreateIndex(t) + client := setupTestClientAndCreateIndex(t, SetSnifferTimeoutStartup(15*time.Second)) p := client.BulkProcessor() if p == nil { @@ -55,7 +49,7 @@ func TestBulkProcessorDefaults(t *testing.T) { func TestBulkProcessorCommitOnBulkActions(t *testing.T) { //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0))) - client := setupTestClientAndCreateIndex(t) + client := setupTestClientAndCreateIndex(t, SetSnifferTimeoutStartup(15*time.Second)) testBulkProcessor(t, 10000, @@ -78,7 +72,7 @@ func TestBulkProcessorCommitOnBulkActions(t *testing.T) { func TestBulkProcessorCommitOnBulkSize(t *testing.T) { //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0))) - client := setupTestClientAndCreateIndex(t) + client := setupTestClientAndCreateIndex(t, SetSnifferTimeoutStartup(15*time.Second)) testBulkProcessor(t, 10000, @@ -101,7 +95,7 @@ func TestBulkProcessorCommitOnBulkSize(t *testing.T) { func TestBulkProcessorBasedOnFlushInterval(t *testing.T) { //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0))) - client := setupTestClientAndCreateIndex(t) + client := setupTestClientAndCreateIndex(t, SetSnifferTimeoutStartup(15*time.Second)) var beforeRequests int64 var befores int64 @@ -186,7 +180,7 @@ func TestBulkProcessorBasedOnFlushInterval(t *testing.T) { func TestBulkProcessorClose(t *testing.T) { //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0))) - client := setupTestClientAndCreateIndex(t) + client := setupTestClientAndCreateIndex(t, SetSnifferTimeoutStartup(15*time.Second)) var beforeRequests int64 var befores int64 @@ -270,7 +264,7 @@ func TestBulkProcessorClose(t *testing.T) { func TestBulkProcessorFlush(t *testing.T) { //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0))) - client := setupTestClientAndCreateIndex(t) + client := setupTestClientAndCreateIndex(t, SetSnifferTimeoutStartup(15*time.Second)) p, err := client.BulkProcessor(). Name("ManualFlush").