Skip to content

Commit

Permalink
Add test for BulkProcessor hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Apr 23, 2019
1 parent 4b51de2 commit dd0c0c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func TestAsyncHook(t *testing.T) {
hookTest(NewAsyncElasticHook, "async-log", t)
}

func TestBulkProcessorHook(t *testing.T) {
hookTest(NewBulkProcessorElasticHook, "async-log", t)
}

func hookTest(hookfunc NewHookFunc, indexName string, t *testing.T) {
if r, err := http.Get("http://127.0.0.1:7777"); err != nil {
log.Fatal("Elastic not reachable")
Expand Down Expand Up @@ -109,8 +113,7 @@ func TestError(t *testing.T) {
Error("Failed to handle invalid api response")

// Allow time for data to be processed.
time.Sleep(1 * time.Second)

time.Sleep(1 * time.Second)
termQuery := elastic.NewTermQuery("Host", "localhost")
searchResult, err := client.Search().
Index("errorlog").
Expand Down

0 comments on commit dd0c0c6

Please sign in to comment.