paritytech / paritytech/web3-storage

Extract shared chain-waiting utilities to reduce E2E and Playwright test duration/flakiness

Open
#136 0 comments 0 reactions 1 assignee View on GitHub

@ilchu is already working on this.

Since Jun 5, 2026.

Dominant language
Rust
Stars
12
Forks
3
Avg merge
2d 2h
Merged PRs (30d)
33

Description

Context

Raised in PR #129 review comment.

The polling-based wait helpers in examples/papi/common.js (waitForBlock, waitForAgreementAcceptance, etc.) are a source of slowness and potential flakiness in both the PAPI E2E test suite and the UI Playwright E2E tests.

Problem

  • Polling is slow: waitForAgreementAcceptance polls chain state every few seconds with a 60s timeout. With 2s dev-mode blocks, this adds unnecessary latency.
  • Shared pain: The UI Playwright tests face the same issue — they also need to wait for on-chain state changes (agreement accepted, bucket created, etc.) and likely use similar polling patterns.
  • Flakiness risk: Polling with fixed timeouts can flake under CI load. Event-based waiting would be more deterministic.

Proposed improvements

  1. Event-based waiting — subscribe to finalized block events and filter for the expected pallet event (e.g. StorageProvider::AgreementAccepted) instead of polling storage. Faster and more reliable.
  2. Shorter block times for Playwright — if Playwright tests don't already use --dev-block-time, switching from Zombienet (6s blocks + finality lag) to dev mode (2s instant-finalized blocks) would cut wait times significantly.
  3. Shared test-helpers package — extract waitForBlock, waitForAgreementAcceptance, and similar utilities into a shared package that both PAPI E2E and Playwright tests consume (related to #135).

Acceptance criteria

  • Audit current wait patterns in E2E and Playwright tests
  • Implement event-subscription-based waiting where possible
  • Evaluate dev-mode chain for Playwright tests
  • Measure before/after test suite duration

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.