Skip to content

Make the rebase E2E tests more resilient#5466

Merged
premun merged 3 commits intodotnet:mainfrom
premun:prvysoky/resiliency
Nov 11, 2025
Merged

Make the rebase E2E tests more resilient#5466
premun merged 3 commits intodotnet:mainfrom
premun:prvysoky/resiliency

Conversation

@premun
Copy link
Copy Markdown
Member

@premun premun commented Nov 11, 2025

Copilot AI review requested due to automatic review settings November 11, 2025 12:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the resilience of E2E rebase tests by introducing a retry mechanism for validating file content in pull requests. Instead of assuming files are immediately available after waiting for a PR update, the new approach retries the verification to handle timing issues where content might not be immediately synchronized.

  • Introduces a new helper method WaitForFileContentInPullRequest that retries file content validation
  • Refactors two test scenarios to use the new helper instead of direct file reads
  • Removes direct file content assertions in favor of the retry-based approach
Comments suppressed due to low confidence (3)

test/ProductConstructionService.ScenarioTests/ScenarioTests/ScenarioTests_CodeFlowRebase.cs:434

  • The retry loop calls WaitForUpdatedPullRequestAsync and CheckoutRemoteRefAsync on every iteration, which are expensive operations. These should only be called once before the loop or include a delay between retries. Consider adding await Task.Delay(WAIT_DELAY) after the content check fails to avoid hammering the system with rapid retries.
    test/ProductConstructionService.ScenarioTests/ScenarioTests/ScenarioTests_CodeFlowRebase.cs:436
  • The error message should include the actual content found and the expected content to aid debugging. Consider changing to: throw new ScenarioTestException($\"File {filePath} in branch {targetBranch} did not have expected content after {maxAttempts} attempts. Expected: '{expectedContent}', but final content did not match.\");
    test/ProductConstructionService.ScenarioTests/ScenarioTests/ScenarioTests_CodeFlowRebase.cs:425
  • The loop variable attempt is unused within the loop body. Consider replacing with for (int i = 0; i < maxAttempts; i++) or using a while loop with a counter that's referenced in the error message to show how many attempts were made.

@premun premun enabled auto-merge (squash) November 11, 2025 13:04
@premun premun merged commit 6bc7919 into dotnet:main Nov 11, 2025
8 of 9 checks passed
@premun premun deleted the prvysoky/resiliency branch November 11, 2025 13:05
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.

3 participants