Skip to content

fix: Retry Linux flake#2535

Merged
bitsandfoxes merged 4 commits intomainfrom
chore/retry-desktop
Feb 12, 2026
Merged

fix: Retry Linux flake#2535
bitsandfoxes merged 4 commits intomainfrom
chore/retry-desktop

Conversation

@bitsandfoxes
Copy link
Contributor

This is similar to #2527
If running the game hangs (i.e. on Linux during startup) the state has to be reset and the tests rerun.

This wraps the existing logic in a max-try = 3 and resets the AppDataDir.

#skip-changelog

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@bitsandfoxes bitsandfoxes requested a review from a team February 12, 2026 14:02
@bitsandfoxes bitsandfoxes merged commit f8d2548 into main Feb 12, 2026
20 checks passed
@bitsandfoxes bitsandfoxes deleted the chore/retry-desktop branch February 12, 2026 14:36
Comment on lines +146 to +149
if ("$AppDataDir" -ne "" -and (Test-Path $AppDataDir))
{
Write-Warning "Removing AppDataDir '$AppDataDir'"
Remove-Item -Force -Recurse $AppDataDir
Copy link

Choose a reason for hiding this comment

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

Bug: A race condition between Stop-Process and Remove-Item can cause the test retry logic to fail because file handles may not be released before the cleanup attempt.
Severity: MEDIUM

Suggested Fix

After calling $process | Stop-Process -Force, add a Wait-Process call (e.g., Wait-Process -Timeout 10) to ensure the process has fully terminated and released all file handles before the script attempts to remove the directory in the next iteration.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: test/Scripts.Integration.Test/run-smoke-test.ps1#L146-L149

Potential issue: A race condition exists in the test retry logic. The script terminates
a process using `Stop-Process -Force` but does not wait for it to fully exit. On the
next retry attempt, the script immediately tries to delete the application data
directory with `Remove-Item`. If the terminated process has not yet released its file
handles, `Remove-Item` will fail. Since `$ErrorActionPreference` is set to `"Stop"`,
this failure will cause an unhandled exception, terminating the entire test run and
preventing any further retries, thus defeating the purpose of the retry mechanism.

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.

2 participants