We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 441c7d8 commit 1c4dfaeCopy full SHA for 1c4dfae
Stackless/unittests/test_shutdown.py
@@ -468,6 +468,25 @@ def other_thread():
468
self.assertEqual(rc, 42)
469
470
471
+def is_high_load():
472
+ try:
473
+ sched_getaffinity = os.sched_getaffinity
474
+ except AttributeError:
475
+ ncpus = os.cpu_count()
476
+ if ncpus is None:
477
+ return False
478
+ else:
479
+ ncpus = len(sched_getaffinity(0))
480
481
+ load = os.getloadavg()[0]
482
+ except (OSError, AttributeError):
483
484
+ if ncpus <= 1:
485
+ return load > 0.5
486
+ return load + 1 > ncpus
487
+
488
489
+@unittest.skipIf(is_high_load(), "system load is to high for this test")
490
class TestInterpreterShutdown(unittest.TestCase):
491
# intentionally not a subclass of StacklessTestCase.
492
0 commit comments