Skip to content

Budget e2e time per scenario, not as a fixed suite total - #111

Merged
leonardoaraujosantos merged 4 commits into
mainfrom
fix/e2e-budget-per-test
Sep 29, 2026
Merged

leonardoaraujosantos merged 4 commits into
mainfrom
fix/e2e-budget-per-test

Conversation

@leonardoaraujosantos

Copy link
Copy Markdown
Contributor

Main is red after #110. The checks job fails with every suite passing, because the end-to-end suite took 120.1 s against its fixed 120 s total budget. That's 185 scenarios, all passing, the slowest at 2.65 s. The same budget was already raised from 60 s and then 90 s for the same reason.

Fix

  • Per scenario: each test is allowed 10 s (setup + call + teardown). One over that fails the run, named, which is the regression the budget exists to catch.
  • Suite backstop: 1.5 s × the number of scenarios. It grows with the suite and still fails if the average doubles.
  • over_budget() is a pure function with unit tests in tests/unit/test_e2e_budget.py:
    • 185 quick scenarios pass;
    • one slow scenario is named;
    • a doubled average fails.
  • docs/operations.md and the e2e-harness OpenSpec tasks are updated.

Checks

  • e2e: 185 passed (93.6 s locally).
  • mypy, ruff and openspec validate --strict pass.

The fixed 120 s total failed main after #110 (120.1 s, 185 passing
scenarios, none over 3 s) and had already been raised from 60 s and
90 s for the same reason. A scenario over 10 s now fails the run by
name, and the suite as a whole is capped at 1.5 s per scenario, so the
cap grows with the suite but still catches a doubled average.
CI for #111 failed on test_live_btc_and_eth_carry_their_quote_time with
CoinGecko answering HTTP 403 to the GitHub runner. The fixture probed
only Frankfurter; the crypto test now pings CoinGecko first and skips on
403/429, the keyless tier refusing a shared IP or a burst.
CoinGecko answers /ping with 200 while refusing /simple/price with a
403 from CloudFront, so the probe let the test run into the refusal.
@leonardoaraujosantos
leonardoaraujosantos merged commit cd6f72e into main Sep 29, 2026
2 checks 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.

1 participant