Skip to content

[Repo Assist] test: add SideEffects module to TaskSeq.WithCancellation.Tests.fs#410

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-withcancellation-sideeffects-20260426-0dfeab7a31817c9a
Draft

[Repo Assist] test: add SideEffects module to TaskSeq.WithCancellation.Tests.fs#410
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-withcancellation-sideeffects-20260426-0dfeab7a31817c9a

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant.

Summary

Adds a module SideEffects to TaskSeq.WithCancellation.Tests.fs with three new tests:

Test What it checks
Applied multiple times (Theory) withCancellation is a transparent wrapper — re-iterating the wrapped sequence advances side effects the same way as re-iterating the source directly
Applied multiple times with active token (Theory) Same, but with a live CancellationTokenSource, verifying the token does not interfere with re-iteration
Evaluates each element exactly once per iteration (Fact) Mutable counter confirms no duplication or skipping: 5 elements → counter = 5 after pass 1, counter = 10 after pass 2

The Theory tests use TestSideEffectTaskSeq data, running over all side-effect sequence variants (sequential, async, nested, spin-wait, etc.) consistent with the rest of the test suite.

Test Status

Passed! - Failed: 0, Passed: 27, Skipped: 0, Total: 27

(previously 10 WithCancellation tests; +17 new)

Full suite: 5251 passed, 0 failed (release build, net10.0).

Fantomas: ✅ clean

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Adds three tests that verify TaskSeq.withCancellation preserves
the re-iteration semantics of the underlying sequence:

- Applied multiple times (Theory over all side-effect variants): each
  iteration yields the next batch of values from the source, confirming
  withCancellation is a transparent wrapper that does not cache state.

- Applied multiple times with an active CancellationToken: same as above
  but with a live CancellationToken, verifying the token is threaded
  through correctly without disrupting re-iteration.

- Evaluates each source element exactly once per iteration: mutable
  counter confirms the side effect runs exactly N times per pass (no
  duplication or skipping).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants