Skip to content

test(bloc_concurrency): cover concurrent, sequential and restartable contracts - #4913

Open
palmoni5 wants to merge 1 commit into
felangel:masterfrom
palmoni5:bloc_concurrency/transformer-contract-tests
Open

palmoni5 wants to merge 1 commit into
felangel:masterfrom
palmoni5:bloc_concurrency/transformer-contract-tests

Conversation

@palmoni5

Copy link
Copy Markdown

Status

READY

Breaking Changes

NO

Description

Adds deterministic tests for the scheduling guarantees of concurrent, sequential and restartable. The tests are driven by Completers and StreamControllers, with no time-based waits.

  • concurrent: invocations of the same handler overlap and can complete out of order.
  • sequential: invocations of the same handler are queued in order, while a handler registered for another event type keeps running.
  • restartable: a new event cancels the previous invocation. Its later emissions are ignored and emit.isDone becomes true, but a future it already started still runs to completion.

Each test was checked against a deliberately broken transformer (for example, restartable replaced by asyncExpand) and fails as expected. Tests only; no library changes.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

…contracts

Add deterministic tests (controlled with completers, no sleeps) for:
- concurrent: invocations overlap and can complete out of order
- sequential: invocations of the same handler are queued, while a handler
  for another event type keeps running
- restartable: a new event cancels the previous invocation's emissions,
  while work it already started runs to completion

This branch has not been deployed

No deployments
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