(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestBulkProcessorDefaults(t *testing.T) { |
| 18 | client := setupTestClientAndCreateIndex(t, SetHealthcheckTimeoutStartup(15*time.Second), SetSnifferTimeoutStartup(15*time.Second)) |
| 19 | |
| 20 | p := client.BulkProcessor() |
| 21 | if p == nil { |
| 22 | t.Fatalf("expected BulkProcessorService; got: %v", p) |
| 23 | } |
| 24 | if got, want := p.name, ""; got != want { |
| 25 | t.Errorf("expected %q; got: %q", want, got) |
| 26 | } |
| 27 | if got, want := p.numWorkers, 1; got != want { |
| 28 | t.Errorf("expected %d; got: %d", want, got) |
| 29 | } |
| 30 | if got, want := p.bulkActions, 1000; got != want { |
| 31 | t.Errorf("expected %d; got: %d", want, got) |
| 32 | } |
| 33 | if got, want := p.bulkSize, 5*1024*1024; got != want { |
| 34 | t.Errorf("expected %d; got: %d", want, got) |
| 35 | } |
| 36 | if got, want := p.flushInterval, time.Duration(0); got != want { |
| 37 | t.Errorf("expected %v; got: %v", want, got) |
| 38 | } |
| 39 | if got, want := p.wantStats, false; got != want { |
| 40 | t.Errorf("expected %v; got: %v", want, got) |
| 41 | } |
| 42 | if got, want := p.retryItemStatusCodes, defaultRetryItemStatusCodes; !reflect.DeepEqual(got, want) { |
| 43 | t.Errorf("expected %v; got: %v", want, got) |
| 44 | } |
| 45 | if p.backoff == nil { |
| 46 | t.Fatalf("expected non-nil backoff; got: %v", p.backoff) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func TestBulkProcessorCommitOnBulkActions(t *testing.T) { |
| 51 | //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0))) |
nothing calls this directly
no test coverage detected
searching dependent graphs…