test: stop alert and discovery tests flaking under load #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/test-webhook-timeouts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
main(run 7) failed once:AlertsDeliveryTest"sends each event to each channel that wants it" got the email but not the webhook within ExUnit's default 100 ms (log read from the runner). It passed on 4 local reruns and on the PR run, so it is a timing flake of the test, not of the code.Database busyfailures in about half of the runs ofAlertsDeliveryTest, and later in other modules.Changes
alerts_delivery_test.exs,alert_live_test.exs: webhook and email deliveries made by other processes over real HTTP are awaited for up to 2 seconds.DataCase: before the sandbox owner stops, wait (one 5 second deadline) for the alert and mail task supervisors' children. A task still writing when its owner went away left SQLite holding a write lock; the next test's first insert failed withDatabase busy.config/database.exs: SQLitebusy_timeout: 15_000in the test configuration only.discovery_test.exs(from #23): no more sleeps and time windows. TTL and retry waits are driven with lifetimes of zero and the key-refresh limit by its lower bound only.Verification
alerts_delivery_test.exssix runs in a row: before, about half of the runs had a failure; with the drain, 6 of 6 passed. A loaded full-suite run with the busy timeout had noDatabase busyin about 2600 tests.mix test: 1508 passed on SQLite and on PostgreSQL.Not resolved