-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
DevProd Build
-
Fully Compatible
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Problem
GoogleTest's ScopedPrematureExitFile assumes that opening the file named by TEST_PREMATURE_EXIT_FILE succeeds. If FOpen returns null, it passes a null FILE* to fwrite and fclose, which is undefined behavior and can terminate the test process before tests run.
Long Windows Bazel paths exposed this issue; permissions and missing directories can also cause the open to fail. Cleanup currently attempts to remove the marker even when opening it failed, and removal diagnostics report the return value rather than the underlying errno.
Fix
Update the MongoDB GoogleTest fork to:
- Guard writes and close operations after opening the marker.
- Only attempt marker cleanup after a successful open.
- Log failed opens and removals with the filename and captured errno message.
When marker creation fails, report the error and allow tests to run. Premature-exit marker detection is unavailable for that run.
This ticket covers only the GoogleTest fork change. Windows test launcher changes remain under SERVER-136639.
Validation
Existing premature-exit tests pass with a writable marker. A failed-open check confirms that a read-only existing marker is preserved and the permission error is logged. An injected removal failure confirms that diagnostics report the actual error message. No new tests are included in the fork PR.
Related changes
- is related to
-
SERVER-136639 Make Windows Bazel test launching and reporting reliable
-
- In Code Review
-
- related to
-
SERVER-136639 Make Windows Bazel test launching and reporting reliable
-
- In Code Review
-