Skip to content

Commit

Permalink
Increase sniffer timeout in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olivere committed Mar 19, 2022
1 parent 7bcdab4 commit 414af00
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions bulk_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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").
Expand Down

0 comments on commit 414af00

Please sign in to comment.