Skip to content

Add report file retry helper tests - #10635

Open
Amaury Levé (Evangelink) wants to merge 1 commit into
mainfrom
dev/amauryleve/test-report-file-retry-helper
Open

Add report file retry helper tests#10635
Amaury Levé (Evangelink) wants to merge 1 commit into
mainfrom
dev/amauryleve/test-report-file-retry-helper

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Adds deterministic unit coverage for ReportFileWriterHelper.RetryWhenIOExceptionAsync.

The tests pin immediate success, transient I/O retries, the strict timeout boundary, the final post-timeout invocation, non-I/O and cancellation propagation, exact invocation counts, and fake-clock read sequences without real-time sleeps.

Closes #10598

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 18, 2026 10:25
@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Aug 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds deterministic unit coverage for shared report-file retry behavior.

Changes:

  • Covers success, retry, timeout-boundary, exception, and cancellation paths.
  • Verifies invocation counts and fake-clock reads without real delays.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/ReportFileWriterHelperTests.cs Adds comprehensive tests for RetryWhenIOExceptionAsync.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🧵 Parallel-safety audit — PR #10635

The only change in this PR is a new test file, test/UnitTests/Microsoft.Testing.Extensions.UnitTests/ReportFileWriterHelperTests.cs, adding ReportFileWriterHelperTests for ReportFileWriterHelper.RetryWhenIOExceptionAsync.

Reviewed every test method and the private SequenceClock fixture: none touch process-global state (env vars, CWD, culture, console, static fields), the filesystem, or a [ResourceLock] / [DoNotParallelize] declaration. The clock is a fully isolated in-memory fake constructed fresh per test, and the code under test (ReportFileWriterHelper.RetryWhenIOExceptionAsync) only calls the injected IClock and the caller-supplied delegate — no shared global reads. No lifecycle members ([TestInitialize]/[ClassInitialize]/etc.) were added or changed, and no assembly-level parallelization declaration changed.

Nothing to flag for parallel-safety.

Audited Microsoft.Testing.Extensions.UnitTests at scope MethodLevel (workers: CPU count, per [assembly: Parallelize(Scope = ExecutionScope.MethodLevel, Workers = 0)] in Program.cs).

Re-run with /parallel-audit.

🤖 Automated content by GitHub Copilot. Generated by the Parallel-safety audit on PR (on open / sync) workflow. · auto · 38.6 AIC · ⌖ 2.85 AIC · ⊞ 24.8K · [◷]( · )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[test-improver] Add unit tests for ReportFileWriterHelper.RetryWhenIOExceptionAsync

3 participants