When not optimized function stack sizes are much larger and may cause this test to fail.
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 429febe..13c017d 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -753,7 +753,8 @@
         lock = threading.Lock()
         self.assertRaises(RuntimeError, lock.release)
 
-    @unittest.skipUnless(sys.platform == 'darwin', 'test macosx problem')
+    @unittest.skipUnless(sys.platform == 'darwin' and test.support.python_is_optimized(),
+                         'test macosx problem')
     def test_recursion_limit(self):
         # Issue 9670
         # test that excessive recursion within a non-main thread causes