Skip to content

Speed up gated e2e tests: replace hardcoded time.Sleep with condition-polling #998

@oskarszoon

Description

@oskarszoon

The gated e2e suites run serial (-parallel 1), so every hardcoded time.Sleep adds directly to wall-clock. ~99s of literal second-sleeps across the gated tests (more in ms/const), and these fixed waits are also a flakiness source.

Fix: replace "sleep N then assert" with poll-until-condition (timeout N). Cuts serial wall-clock and de-flakes.

Files (gated: test/e2e/daemon/ready + test/sequentialtest):

  • test/e2e/daemon/ready/banlist_e2e_test.go — 8× 5s @ lines 48, 83, 180, 286, 357, 453, 509, 557 (~40s, biggest single offender)
  • test/e2e/daemon/ready/utxo_test.go:28610s
  • test/e2e/daemon/ready/multi_node_send_2_tx_test.go:5810s
  • test/e2e/daemon/ready/reorg_test.go — ~9s (incl :333)
  • test/e2e/daemon/ready/smoke_test.go — ~8s (5 sleeps, incl :2097)
  • test/e2e/daemon/ready/pruner_parent_before_child_test.go:2045s
  • test/sequentialtest/block_assembly/block_assembly_restart_test.go — ~6s (3 sleeps)
  • test/e2e/daemon/ready/legacy_sync_test.go — ~4.8s (7 small)
  • test/e2e/daemon/ready/block_persister_test.go — ~4s

Out of scope: test/e2e/daemon/wip/* sleeps (kafka_tls ~44s, unmined_tx_cleanup ~22s, invalid_block ~20s) — wip/ is not run by the smoke gate (smoke runs the ready/ package). Verify wip/ isn't run by a nightly before touching.

Related: #997 — the FSM-readiness ceiling in test/nodeHelpers/blockchainDaemon.go. Fixing it lets several of these sleeps be deleted outright rather than converted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions