diff --git a/README.md b/README.md index 9d2676bf..73548b3c 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ Fully synchrounos. Useful for testing/experimentation. Experimental driver. +### Kafka + +https://github.com/Kistler-Group/eh-kafka + ## Development To develop Event Horizon you need to have Docker and Docker Compose installed. diff --git a/eventbus/acceptance_testing.go b/eventbus/acceptance_testing.go index 97e96b0f..da390a0e 100644 --- a/eventbus/acceptance_testing.go +++ b/eventbus/acceptance_testing.go @@ -35,7 +35,7 @@ import ( // eventbus.AcceptanceTest(t, bus1, bus2) // } // -func AcceptanceTest(t *testing.T, bus1, bus2 eh.EventBus) { +func AcceptanceTest(t *testing.T, bus1, bus2 eh.EventBus, timeout time.Duration) { // Panic on nil matcher. func() { defer func() { @@ -101,7 +101,7 @@ func AcceptanceTest(t *testing.T, bus1, bus2 eh.EventBus) { // Check for correct event in handler 1 or 2. expectedEvents := []eh.Event{event1} - if !(handlerBus1.Wait(time.Second) || handlerBus2.Wait(time.Second)) { + if !(handlerBus1.Wait(timeout) || handlerBus2.Wait(timeout)) { t.Error("did not receive event in time") } if !(mocks.EqualEvents(handlerBus1.Events, expectedEvents) || @@ -133,7 +133,7 @@ func AcceptanceTest(t *testing.T, bus1, bus2 eh.EventBus) { } // Check the other handler. - if !anotherHandlerBus2.Wait(time.Second) { + if !anotherHandlerBus2.Wait(timeout) { t.Error("did not receive event in time") } if !mocks.EqualEvents(anotherHandlerBus2.Events, expectedEvents) { @@ -145,7 +145,7 @@ func AcceptanceTest(t *testing.T, bus1, bus2 eh.EventBus) { } // Check observer 1. - if !observerBus1.Wait(time.Second) { + if !observerBus1.Wait(timeout) { t.Error("did not receive event in time") } for i, event := range observerBus1.Events { @@ -158,7 +158,7 @@ func AcceptanceTest(t *testing.T, bus1, bus2 eh.EventBus) { } // Check observer 2. - if !observerBus2.Wait(time.Second) { + if !observerBus2.Wait(timeout) { t.Error("did not receive event in time") } for i, event := range observerBus2.Events { diff --git a/eventbus/gcp/eventbus_test.go b/eventbus/gcp/eventbus_test.go index 8402834b..1d097d9f 100644 --- a/eventbus/gcp/eventbus_test.go +++ b/eventbus/gcp/eventbus_test.go @@ -19,6 +19,7 @@ import ( "encoding/hex" "os" "testing" + "time" "github.com/looplab/eventhorizon/eventbus" ) @@ -46,6 +47,6 @@ func TestEventBus(t *testing.T) { t.Fatal("there should be no error:", err) } - eventbus.AcceptanceTest(t, bus1, bus2) + eventbus.AcceptanceTest(t, bus1, bus2, time.Second) } diff --git a/eventbus/local/eventbus_test.go b/eventbus/local/eventbus_test.go index 3e579ce2..7faaf951 100644 --- a/eventbus/local/eventbus_test.go +++ b/eventbus/local/eventbus_test.go @@ -16,6 +16,7 @@ package local import ( "testing" + "time" "github.com/looplab/eventhorizon/eventbus" ) @@ -36,6 +37,6 @@ func TestEventBus(t *testing.T) { t.Fatal("there should be a bus") } - eventbus.AcceptanceTest(t, bus1, bus2) + eventbus.AcceptanceTest(t, bus1, bus2, time.Second) }