open-nomad/e2e/events
Tim Gross 31e72e93ff
E2E: fix flaky event stream test (#12548)
This changeset fixes two sources of flakiness in the event stream test.

First, the stream request gets the event *closest* to the index, not
the exact match. Although events are written before raft entries
they're written asynchronously, so it's possible to race and get a
raft index from this query higher than the current head of the event
buffer. Ensure the job is running before we try to get the index, so
that we've given the event enough time to land in the buffer.

Second, the assertion that the found index is greater than the start
index is only true if the `PlanResult` event manages to land before we
do the second registration. Although it should now with the first fix
above, it's not a correct assertion for what we're testing.
2022-04-12 08:35:39 -04:00
..
input E2E: fix flaky event stream test (#12548) 2022-04-12 08:35:39 -04:00
events.go E2E: fix flaky event stream test (#12548) 2022-04-12 08:35:39 -04:00