[SERVER-35284] C++ "death test" unit tests should fork before constructing the test fixture, not after. Created: 30/May/18  Updated: 29/Oct/23  Resolved: 30/May/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.0.3, 4.1.1

Type: Bug Priority: Minor - P4
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Participants:

 Description   

The C++ death test implementation on posix systems uses fork to produce a child process in which to run the test that is expected to terminate the process. The current implementation constructs the test fixture and then forks the process. However, this behavior is incorrect, because the test fixture constructor may create threads. The fixture should be constructed in the child process after the call to fork().



 Comments   
Comment by Githook User [ 07/Sep/18 ]

Author:

{'name': 'Andy Schwerin', 'email': 'schwerin@mongodb.com', 'username': 'amschwerin'}

Message: SERVER-35284 Construct unit test fixtures only in the child process in C++ death tests.

(cherry picked from commit 2bc714a6f9a9167e7c447bca6c684f1bce739b17)
Branch: v4.0
https://github.com/mongodb/mongo/commit/2228531a653cbe1a0761dc433bb1446f3193a6b2

Comment by Githook User [ 30/May/18 ]

Author:

{'username': 'amschwerin', 'name': 'Andy Schwerin', 'email': 'schwerin@mongodb.com'}

Message: SERVER-35284 Construct unit test fixtures only in the child process in C++ death tests.
Branch: master
https://github.com/mongodb/mongo/commit/2bc714a6f9a9167e7c447bca6c684f1bce739b17

Generated at Thu Feb 08 04:39:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.