Skip to content

tests: be less flaky due to timing issues - #23

Merged
lonvia merged 1 commit into
fossgis:masterfrom
cldellow:dispatcher-test-race
Dec 1, 2026
Merged

lonvia merged 1 commit into
fossgis:masterfrom
cldellow:dispatcher-test-race

Conversation

@cldellow

Copy link
Copy Markdown

Now that the tests are merged and running more often, we see some additional tests that are flaky due to timing.

This PR skips two more osm3s_query tests that have timeouts that can succeed/fail based on load: 22 and 68.

It also adjusts how the template_db suite works by sleep 1ing after the dispatcher is started but before the client runs.

Sleeps are a distasteful way to solve this. They don't guarantee the problem is avoided, and they waste time in the happy path when the dispatcher startup takes less than 1 second.

Still, I think it's probably good enough for these tests:

  • it's what other tests who launch the dispatcher do
  • it's a smaller change to review than rewriting the harness to pipe the server's output somewhere and wait for a log that signals that it's ready to receive requests
  • under dozens of re-runs under simulated load, no more failures were observed

test_dispatcher 21 to 26: dispatcher_client_server and
dispatcher_two_clients started the test server in the background and
ran the client straight away. The server creates the dispatcher, then
does a write of its own before it serves. A client that got ahead of it
either couldn't open the shared memory, or found the server's
test-shadow.lock and failed its "lock doesn't exist before
write_start()" check. Wait a second after starting the server, as the
other suites do after starting the dispatcher.

osm3s_query 22 and 68: their queries have a one second timeout and are
expected to complete, so they fail when the machine is slow. Skip them,
like tests 19, 28, 31, 34, 66 and 67.

Co-Authored-By: Colin Dellow <cldellow@gmail.com>
@lonvia
lonvia merged commit a7ff7ab into fossgis:master Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants