[CDRIVER-1122] Don't just fork(), exec(), in the test suite Created: 18/Feb/16  Updated: 10/Aug/16  Resolved: 17/May/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.4.0
Fix Version/s: 1.4.0

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CDRIVER-1118 Avoid abort() on test failure on windows Closed
Related
related to CDRIVER-1118 Avoid abort() on test failure on windows Closed
is related to CDRIVER-520 Add support for native TLS on OSX (Se... Closed
Epic Link: C Driver in Evergreen

 Description   

Currently our test suite can fork() before running the tests.

We use this on *nix because we'd like to continue running the next test case, even if one of them fails, and then in the end we generate test-results.json file that is uploaded to evergreen for graphing.

Prior to fork()ing though, we do a full mongoc initialization and print out a test header with the connection uri and things.

On Windows, this switch doesn't do anything (and the header lies about it fork()ing).

On OSX, using NativeSSL, we hit the problem of its random number generator is not fork() safe.
For the purpose of mongoc generating a random number, we could work around this – but the problem is that the TLS layer uses this fork() unsafe API in its SSLHandshake() method.
This means, due to the initial mongoc bootstrapping and header printout, the fork() children share the entropy with its parent and OSX seems to protect against that by simply abort()ing.

We should unify this on all OSs by always launching a new clean process.
That way we can provide the same test suite experience on Windows and Linux, and not segfault on OSX.



 Comments   
Comment by Githook User [ 17/May/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1122 exec or CreateProcess for each test

On Mac with native TLS we must exec() to reseed the RNG, otherwise it
aborts. For consistency, exec() on all Unix. On Windows, CreateProcess.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/63a1342e468a487814bde2772b5e6e68455fc91f

Generated at Wed Feb 07 21:11:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.