Skip to content

.NET: Stabilize Foundry recovery tests - #7817

Merged
Roger Barreto (rogerbarreto) merged 3 commits into
microsoft:mainfrom
rogerbarreto:foundry-hosted-flacky-ut
Aug 24, 2026
Merged

.NET: Stabilize Foundry recovery tests#7817
Roger Barreto (rogerbarreto) merged 3 commits 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

Two Foundry recovery tests could observe state before the platform finished the durable operation they intended to verify.

The local two lifetime unit test stopped the host after the live HTTP response exposed new output, but before AgentServer had saved the matching checkpoint. The live integration test ended the process immediately after the workflow input stage, which could race the first durable recovery boundary and leave a completed response containing only workflow action items. During process replacement, response polling can also return HTTP 409 session_updating and explicitly ask the caller to retry.

Description & Review Guide

  • What are the major changes? The unit test now observes checkpoint processing through a test response handler before stopping the host. The live test waits five seconds before the intentional process exit, matching the existing countdown crash scenario. Recovery polling now treats HTTP 409 as transient alongside the existing replacement statuses.
  • What is the impact of these changes? Test behavior becomes synchronized with the durable state it asserts. Production code and public APIs are unchanged.
  • What do you want reviewers to focus on? Confirm that both tests wait for the operation they verify and that the new retry remains limited to the temporary hosted session update response.

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.

@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.

@rogerbarreto Roger Barreto (rogerbarreto) changed the title .NET: Fix flaky Foundry recovery test synchronization .NET: Stabilize Foundry recovery tests Aug 24, 2026
@rogerbarreto
Roger Barreto (rogerbarreto) added this pull request to the merge queue Aug 24, 2026
Merged via the queue into microsoft:main with commit a2a8635 Aug 24, 2026
35 of 38 checks passed
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 tests

3 participants