Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1122

Don't just fork(), exec(), in the test suite

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • None

      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.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: