@@ -9,19 +9,13 @@ import (
99 "fmt"
1010 "math/rand"
1111 "reflect"
12- "runtime"
1312 "sync/atomic"
1413 "testing"
1514 "time"
1615)
1716
1817func TestBulkProcessorDefaults (t * testing.T ) {
19- // TODO This test is flaky on Go 1.18. I have no idea why. All other tests work.
20- if runtime .Version () == "go1.18" {
21- t .Skipf ("This test is flaky on Go 1.18. I have no idea why. All other tests work." )
22- }
23-
24- client := setupTestClientAndCreateIndex (t )
18+ client := setupTestClientAndCreateIndex (t , SetSnifferTimeoutStartup (15 * time .Second ))
2519
2620 p := client .BulkProcessor ()
2721 if p == nil {
@@ -55,7 +49,7 @@ func TestBulkProcessorDefaults(t *testing.T) {
5549
5650func TestBulkProcessorCommitOnBulkActions (t * testing.T ) {
5751 //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0)))
58- client := setupTestClientAndCreateIndex (t )
52+ client := setupTestClientAndCreateIndex (t , SetSnifferTimeoutStartup ( 15 * time . Second ) )
5953
6054 testBulkProcessor (t ,
6155 10000 ,
@@ -78,7 +72,7 @@ func TestBulkProcessorCommitOnBulkActions(t *testing.T) {
7872
7973func TestBulkProcessorCommitOnBulkSize (t * testing.T ) {
8074 //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0)))
81- client := setupTestClientAndCreateIndex (t )
75+ client := setupTestClientAndCreateIndex (t , SetSnifferTimeoutStartup ( 15 * time . Second ) )
8276
8377 testBulkProcessor (t ,
8478 10000 ,
@@ -101,7 +95,7 @@ func TestBulkProcessorCommitOnBulkSize(t *testing.T) {
10195
10296func TestBulkProcessorBasedOnFlushInterval (t * testing.T ) {
10397 //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0)))
104- client := setupTestClientAndCreateIndex (t )
98+ client := setupTestClientAndCreateIndex (t , SetSnifferTimeoutStartup ( 15 * time . Second ) )
10599
106100 var beforeRequests int64
107101 var befores int64
@@ -186,7 +180,7 @@ func TestBulkProcessorBasedOnFlushInterval(t *testing.T) {
186180
187181func TestBulkProcessorClose (t * testing.T ) {
188182 //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0)))
189- client := setupTestClientAndCreateIndex (t )
183+ client := setupTestClientAndCreateIndex (t , SetSnifferTimeoutStartup ( 15 * time . Second ) )
190184
191185 var beforeRequests int64
192186 var befores int64
@@ -270,7 +264,7 @@ func TestBulkProcessorClose(t *testing.T) {
270264
271265func TestBulkProcessorFlush (t * testing.T ) {
272266 //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0)))
273- client := setupTestClientAndCreateIndex (t )
267+ client := setupTestClientAndCreateIndex (t , SetSnifferTimeoutStartup ( 15 * time . Second ) )
274268
275269 p , err := client .BulkProcessor ().
276270 Name ("ManualFlush" ).
0 commit comments