Skip to content

Commit

Permalink
Wait for receiver to be done (#5509)
Browse files Browse the repository at this point in the history
This polls, unlike AssertReceivedAll. My theory is that in slow
environments the time between sender being done and receiver being done
might be significant enough to fail a test.
  • Loading branch information
Ben Moss authored Jun 15, 2021
1 parent b0b32c4 commit 39d1977
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/rekt/features/broker/source_to_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ func SourceToTwoSinksWithDLQ(brokerName string) *feature.Feature {

// After we have finished sending.
f.Requirement("sender is finished", prober.SenderDone("source"))
f.Requirement("receiver 1 is finished", prober.ReceiverDone("source", "sink1"))
f.Requirement("receiver 2 is finished", prober.ReceiverDone("source", "sink2"))

// Assert events ended up where we expected.
f.Stable("broker with DLQ").
Expand Down
2 changes: 2 additions & 0 deletions test/rekt/features/channel/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func EventTransformation() *feature.Feature {
f.Setup("event library is ready", eventlibrary.IsReady(lib))

f.Requirement("sender is finished", prober.SenderDone("source"))
f.Requirement("receiver is finished", prober.ReceiverDone("source", "sink"))

f.Assert("sink receives events", prober.AssertReceivedAll("source", "sink"))
f.Assert("events have passed through transform service", func(ctx context.Context, t feature.T) {
Expand Down Expand Up @@ -177,6 +178,7 @@ func SingleEventWithEncoding(encoding binding.Encoding) *feature.Feature {
f.Setup("install source", prober.SenderInstall("source", eventshub.InputEventWithEncoding(event, encoding)))

f.Requirement("sender is finished", prober.SenderDone("source"))
f.Requirement("receiver is finished", prober.ReceiverDone("source", "sink"))

f.Assert("sink receives events", prober.AssertReceivedAll("source", "sink"))

Expand Down

0 comments on commit 39d1977

Please sign in to comment.