Skip to content

.NET: Fix flaky Foundry recovery test synchronization - #7817

Open
Roger Barreto (rogerbarreto) wants to merge 1 commit into
microsoft:mainfrom
rogerbarreto:foundry-hosted-flacky-ut
Open

.NET: Fix flaky Foundry recovery test synchronization#7817
Roger Barreto (rogerbarreto) wants to merge 1 commit into
microsoft:mainfrom
rogerbarreto:foundry-hosted-flacky-ut

Conversation

@rogerbarreto

@rogerbarreto Roger Barreto (rogerbarreto) commented Aug 22, 2026

Copy link
Copy Markdown
Member

Motivation & Context

The Foundry two lifetime recovery test could read the response file stored on disk immediately after the live HTTP response exposed new output. AgentServer writes that output during the next saved recovery point, which the code calls a checkpoint, so the test could stop the host while the file still contained the previous checkpoint.

Description & Review Guide

  • What are the major changes? Wait for the expected output in the response file before stopping the first host. Retry the specific IOException raised while the checkpoint writer briefly owns the file.
  • What is the impact of these changes? This removes a test synchronization race without changing production behavior.
  • What do you want reviewers to focus on? Confirm that the test now synchronizes with the saved recovery state and that file read retries remain limited to the expected sharing conflict.

Related Issue

Fixes #7816

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix). A workflow keeps the label and title prefix in sync automatically.

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

Synchronizes the Foundry recovery test with persisted checkpoint state instead of live HTTP output.

Changes:

  • Polls the persisted response file for expected output.
  • Retries file-read failures and improves timeout diagnostics.

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

return;
}
}
catch (IOException ex)

@github-actions github-actions Bot 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.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): 03e9ab871403
Model: gpt-5.6-sol

Overview

This test-only change replaces synchronization against live HTTP output with polling of the durable response envelope before stopping the first host. Exact ordered-output checks, bounded polling, post-shutdown persistence assertions, and end-to-end recovery assertions constrain the behavior well. No Critical, High, or Medium defect was established.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

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

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: [Bug]: Stabilize Foundry recovery test checkpoint synchronization

2 participants