Skip to content

Commit 8816fef

Browse files
ostermanclaude
andcommitted
fix: Allow multiple Output calls in test for Windows retry logic
The retryOnWindows function retries failed terraform output calls up to 3 times on Windows. Update the mock expectation to use AnyTimes() to prevent flaky test failures on Windows CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 8f0c520 commit 8816fef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/terraform/output/executor_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ func TestExecutor_ExecuteWithSections_OutputError(t *testing.T) {
301301
mockRunner.EXPECT().SetEnv(gomock.Any()).Return(nil).AnyTimes()
302302
mockRunner.EXPECT().Init(gomock.Any(), gomock.Any()).Return(nil)
303303
mockRunner.EXPECT().WorkspaceNew(gomock.Any(), "test-workspace").Return(nil)
304-
mockRunner.EXPECT().Output(gomock.Any()).Return(nil, errors.New("output failed"))
304+
// Use AnyTimes() because retryOnWindows may call Output multiple times on Windows.
305+
mockRunner.EXPECT().Output(gomock.Any()).Return(nil, errors.New("output failed")).AnyTimes()
305306

306307
_, err := exec.ExecuteWithSections(atmosConfig, "test-component", "test-stack", sections, nil)
307308
require.Error(t, err)

0 commit comments

Comments
 (0)