diff --git a/test/test_encryption.py b/test/test_encryption.py index e4372d7e5..cf34ca61a 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -51,6 +51,7 @@ from test.utils import ( TestCreator, TopologyEventListener, camel_to_snake_args, + is_greenthread_patched, rs_or_single_client, wait_until, ) @@ -334,6 +335,10 @@ class TestClientSimple(EncryptionIntegrationTest): not hasattr(os, "register_at_fork"), "register_at_fork not available in this version of Python", ) + @unittest.skipIf( + is_greenthread_patched(), + "gevent and eventlet do not support POSIX-style forking.", + ) def test_fork(self): opts = AutoEncryptionOpts(KMS_PROVIDERS, "keyvault.datakeys") client = rs_or_single_client(auto_encryption_opts=opts) diff --git a/test/test_fork.py b/test/test_fork.py index 41ce16249..df1f009e2 100644 --- a/test/test_fork.py +++ b/test/test_fork.py @@ -17,7 +17,11 @@ import os from multiprocessing import Pipe from test import IntegrationTest, client_context -from test.utils import ExceptionCatchingThread, rs_or_single_client +from test.utils import ( + ExceptionCatchingThread, + is_greenthread_patched, + rs_or_single_client, +) from unittest import skipIf from bson.objectid import ObjectId @@ -32,6 +36,10 @@ def setUpModule(): @skipIf( not hasattr(os, "register_at_fork"), "register_at_fork not available in this version of Python" ) +@skipIf( + is_greenthread_patched(), + "gevent and eventlet do not support POSIX-style forking.", +) class TestFork(IntegrationTest): def test_lock_client(self): """ @@ -156,5 +164,8 @@ class TestFork(IntegrationTest): for t in threads: t.join() + for t in threads: + self.assertIsNone(t.exc) + for c in clients: c.close()