Skip to content

Fix flaky StartScriptShouldWaitForAShortScriptToFinish test - #1382

Open
gb-8 wants to merge 1 commit into
mainfrom
claude/sharp-cray-6bhvrd
Open

gb-8 wants to merge 1 commit into
mainfrom
claude/sharp-cray-6bhvrd

Conversation

@gb-8

@gb-8 gb-8 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Background

Fixes LEV-2418

ScriptServiceV2Fixture.StartScriptShouldWaitForAShortScriptToFinish fails intermittently on Windows.

The test asserts that when a script finishes within the timespan the start command specifies, then StartScript should return Running.

However, it using a timespan of 5 seconds, and even the 1 line echo script it uses does not always complete within 5 seconds, due to how long it can take to start PowerShell on a busy agent.

Tentacle behaved correctly. The test was effectively asserting that PowerShell can run echo in under 5 seconds on the build agent.

Results

The we increase the start command's timespan from 5 seconds to 60 seconds.
StartScript returns as soon as the script completes, so passing runs take no longer.

Before

Expected startScriptResponse.State to be ProcessState.Complete {value: 2}, but found ProcessState.Running {value: 1}.

Intermittent failure: 2 of the latest 100 runs for this configuration.

After

The test passes unless the shell takes longer than 60 seconds to run echo.

How to review this PR

Quality ✔️

Test-only change. Does the reasoning make sense. Is this still a valuable test?

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

@gb-8
gb-8 requested a review from a team as a code owner November 26, 2026 06:24
@CLAassistant

CLAassistant commented Nov 26, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

StartScriptShouldWaitForAShortScriptToFinish asked StartScript to wait up
to 5 seconds for `echo "finished"`. On busy Windows agents, PowerShell
startup alone can exceed that, so StartScript correctly returned Running
and the test failed intermittently (e.g. 5,297 ms on win-x86).

Raise the window to 60 seconds. StartScript returns as soon as the script
completes, so passing runs are no slower.

Claude-Session: https://claude.ai/code/session_012a7MWUgDDfPmxcoi6ZFskC
@gb-8
gb-8 force-pushed the claude/sharp-cray-6bhvrd branch from 5c6cb01 to e4a5e7a Compare November 26, 2026 08:36
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