MCPcopy Create free account
hub / github.com/olivere/elastic / TestBulkProcessorDefaults

Function TestBulkProcessorDefaults

bulk_processor_test.go:17–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func 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
50func TestBulkProcessorCommitOnBulkActions(t *testing.T) {
51 //client := setupTestClientAndCreateIndexAndLog(t, SetTraceLog(log.New(os.Stdout, "", 0)))

Callers

nothing calls this directly

Calls 6

SetSnifferTimeoutStartupFunction · 0.85
BulkProcessorMethod · 0.80
FatalfMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…