-
Notifications
You must be signed in to change notification settings - Fork 462
NO-ISSUE: Fix TestMissingImageIsRebuilt goroutine safety issue #5477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Replace require.NoError() with assert.NoError() in background goroutines that stream pod logs. require.NoError() calls t.FailNow() which internally calls runtime.Goexit(), terminating only the current goroutine without stopping the test. This causes undefined behavior and test failures. assert.NoError() marks the test as failed without calling Goexit(), making it safe to use in goroutines. This fixes the test failure where log streaming goroutines would silently fail without properly reporting errors.
|
@umohnani8: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/test e2e-gcp-op-ocl |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: umohnani8 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-gcp-op-ocl |
2 similar comments
|
/test e2e-gcp-op-ocl |
|
/test e2e-gcp-op-ocl |
Signed-off-by: Urvashi <umohnani@redhat.com>
|
/test e2e-gcp-op-ocl |
The previous commit (48d070c) fixed the goroutine call sites by changing require.NoError() to assert.NoError(), but missed a require.NoError() call INSIDE streamMachineOSBuilderPodLogsToFile() that is still executed in the goroutine's call stack. When streamMachineOSBuilderPodLogsToFile() is called from a goroutine and encounters an error listing pods, it calls require.NoError(t, err) which internally calls t.FailNow() -> runtime.Goexit(). This terminates only the current goroutine without properly failing the test, causing undefined behavior and test hangs. This commit: 1. Replaces require.NoError() with proper error returns in streamMachineOSBuilderPodLogsToFile() 2. Adds bounds checking for the pods.Items slice 3. Adds debug logging to waitForBuildToComplete() that logs build status every 30 seconds to help diagnose future timeout issues This should resolve the persistent test timeouts that appeared after the original goroutine safety fix.
|
/test e2e-gcp-op-ocl |
|
@umohnani8: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
- What I did
Replace require.NoError() with assert.NoError() in background goroutines that stream pod logs. require.NoError() calls t.FailNow() which internally calls runtime.Goexit(), terminating only the current goroutine without stopping the test. This causes undefined behavior and test failures.
assert.NoError() marks the test as failed without calling Goexit(), making it safe to use in goroutines.
This fixes the test failure where log streaming goroutines would silently fail without properly reporting errors.
- How to verify it
Failures in the TestMissingImageIsRebuilt should be reported in the logs
- Description for the changelog
Fix logs for TestMissingImageIsRebuilt