Skip to content

Flaky: TestDevMiningManager polls only 5s for a multi-second PoW #174

Description

@tuliomir

Two tests in TestDevMiningManager fail intermittently under coverage — observed roughly 2 failures in 8 local runs:

  • test_submit_job_with_parents
  • test_submit_job_with_propagate

Both submit TX1_DATA at its natural weight (~32) and then poll for completion with for _ in range(50): await asyncio.sleep(0.1) — a 5-second budget. The file's own comment describes that PoW as taking "a few seconds", so the margin is thin to begin with, and pytest --cov instrumentation slows the nonce loop enough to push it over. The failure surfaces as the poll loop exiting while the job is still mining, so the assertion reads as a wrong status rather than a timeout, which makes it easy to misread as a real regression.

Each test passes reliably in isolation and the suite passes without coverage, so nothing is wrong with the code under test — only with the budget the harness allows it.

Suggested fix: widen the poll budget in those tests (e.g. range(200) for 20s), or drop the tx weight the way TestSolveTx does for its trivial-weight case. No assertion changes needed.

Noticed while validating #173; it predates that PR and is unrelated to it, so it was deliberately left out of that changeset.

Acceptance criteria

  • The two tests pass consistently with pytest --cov over repeated runs.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions