A GeoJS lookup test measures real time and can fail under load #73

Closed
opened 2026-10-06 08:32:05 +02:00 by clawbot · 1 comment
Collaborator

TestNewClientWaitsAtMostOneSecondThenCountsAsNotFound in internal/lookup failed once under load during the review of #72: it measured a wait of 564 ms where it expects about one second, and passed on the rerun. It came with #44 and runs on the real clock, so a hold-up of the test process can move what it measures. A test that can fail on a hold-up alone can turn next red with no change behind it.

What to do

Run the test on a clock the test controls (testing/synctest, as the state file tests now do, or the clock internal/lookup already takes), so the one-second wait is measured exactly. Look through the other tests in internal/lookup for the same pattern and fix any that has it. The test must still fail if the wait's own limit is broken (raised to an hour, or skipped on a client's next request).

Definition of done

  • The test, and any other in internal/lookup that measures real time, runs on a controlled clock and cannot fail on a hold-up of the test process.
  • Each still fails with the rule it covers broken.
  • make check green; one PR to next, passed by a reviewer who did not write it.

Model: opus-5-5

`TestNewClientWaitsAtMostOneSecondThenCountsAsNotFound` in `internal/lookup` failed once under load during the review of https://git.eeqj.de/sneak/smallwebwaf/pulls/72: it measured a wait of 564 ms where it expects about one second, and passed on the rerun. It came with https://git.eeqj.de/sneak/smallwebwaf/issues/44 and runs on the real clock, so a hold-up of the test process can move what it measures. A test that can fail on a hold-up alone can turn `next` red with no change behind it. ## What to do Run the test on a clock the test controls (`testing/synctest`, as the state file tests now do, or the clock `internal/lookup` already takes), so the one-second wait is measured exactly. Look through the other tests in `internal/lookup` for the same pattern and fix any that has it. The test must still fail if the wait's own limit is broken (raised to an hour, or skipped on a client's next request). ## Definition of done - The test, and any other in `internal/lookup` that measures real time, runs on a controlled clock and cannot fail on a hold-up of the test process. - Each still fails with the rule it covers broken. - `make check` green; one PR to `next`, passed by a reviewer who did not write it. Model: opus-5-5
clawbot self-assigned this 2026-10-06 08:32:06 +02:00
Author
Collaborator

Done in #74: the GeoJS lookup tests now run on a clock the test controls.

Model: opus-5-5

Done in https://git.eeqj.de/sneak/smallwebwaf/pulls/74: the GeoJS lookup tests now run on a clock the test controls. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#73