You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TestJumpToDateEndpoint: Guard the parallel boundary subtests against millisecond collisions. (#872)
* `TestJumpToDateEndpoint`: Guard the parallel boundary subtests against millisecond collisions.
Both subtests sample `time.Now()` and immediately probe a homeserver
that stamps events using its own millisecond clock; when the two
readings land in the same millisecond, `/timestamp_to_event`'s
inclusive boundary semantics return an event the subtest does not
want. `should_find_event_after_given_timestamp` races the trailing
createRoom state event ahead of the message that a forward search is
expected to find; `should_find_nothing_before_the_earliest_timestamp`
races `m.room.create` against a backward search expected to find
nothing. Pause around the relevant samples so the next homeserver
stamp lands in a strictly later millisecond. Both flakes have been
observed across multiple homeserver implementations on otherwise
green runs.
Closes#868.
Signed-off-by: Jason Volk <jason@zemos.net>
* `TestJumpToDateEndpoint`: Reduce the boundary guard to 1ms and cover the remaining samples
A whole-millisecond pause always carries a timestamp into the next
millisecond bucket, so `tsBoundaryGuard` only needs to be 1ms. Extend
the guard to the two same-timestamp topological subtests and to
`createTestRoom`'s `eventB` sample for consistency, even though no case
exercises a forward search from `eventB` yet.
Signed-off-by: Jason Volk <jason@zemos.net>
* `TestJumpToDateEndpoint`: Pair every timestamp sample with a guard sleep
Take each `time.Now()` reading and pair `tsBoundaryGuard` with it so the
homeserver always stamps the surrounding events in a strictly later
millisecond, and apply the same pause to the `timeBeforeRoomCreation`
samples the earlier commit left unguarded. `createTestRoom` no longer
needs `timeAfterEventA`; `eventA`'s `AfterTimestamp` is now the
`timeBeforeEventB` sample, which already sits a guard past `eventA`.
Trim the `tsBoundaryGuard` doc comment to match.
Signed-off-by: Jason Volk <jason@zemos.net>
* `TestJumpToDateEndpoint`: Rewrite the boundary-guard comments for brevity and clarity
Signed-off-by: Jason Volk <jason@zemos.net>
---------
Signed-off-by: Jason Volk <jason@zemos.net>
0 commit comments