|
20 | 20 | withThreads = False |
21 | 21 |
|
22 | 22 | from support import test_main # @UnusedImport |
23 | | -from support import StacklessTestCase, AsTaskletTestCase, require_one_thread |
| 23 | +from support import StacklessTestCase, AsTaskletTestCase, require_one_thread, testcase_leaks_references |
24 | 24 |
|
25 | 25 |
|
26 | 26 | def is_soft(): |
@@ -613,18 +613,22 @@ def other_thread_main(): |
613 | 613 | tlet.kill() |
614 | 614 |
|
615 | 615 | @unittest.skipUnless(withThreads, "requires thread support") |
| 616 | + @testcase_leaks_references("chatches TaskletExit and does not die in its own thread", soft_switching=False) |
616 | 617 | def test_kill_without_thread_state_nl0(self): |
617 | 618 | return self._test_kill_without_thread_state(0, False) |
618 | 619 |
|
619 | 620 | @unittest.skipUnless(withThreads, "requires thread support") |
| 621 | + @testcase_leaks_references("chatches TaskletExit and does not die in its own thread") |
620 | 622 | def test_kill_without_thread_state_nl1(self): |
621 | 623 | return self._test_kill_without_thread_state(1, False) |
622 | 624 |
|
623 | 625 | @unittest.skipUnless(withThreads, "requires thread support") |
| 626 | + @testcase_leaks_references("chatches TaskletExit and does not die in its own thread", soft_switching=False) |
624 | 627 | def test_kill_without_thread_state_blocked_nl0(self): |
625 | 628 | return self._test_kill_without_thread_state(0, True) |
626 | 629 |
|
627 | 630 | @unittest.skipUnless(withThreads, "requires thread support") |
| 631 | + @testcase_leaks_references("chatches TaskletExit and does not die in its own thread") |
628 | 632 | def test_kill_without_thread_state_blocked_nl1(self): |
629 | 633 | return self._test_kill_without_thread_state(1, True) |
630 | 634 |
|
@@ -1098,6 +1102,7 @@ def test(): |
1098 | 1102 | self.assertEqual(self.recursion_depth_in_test, 1) |
1099 | 1103 |
|
1100 | 1104 | @unittest.skipUnless(withThreads, "requires thread support") |
| 1105 | + @testcase_leaks_references("Tasklet chatches TaskletExit and refuses to die in its thread") |
1101 | 1106 | def test_unbind_fail_cstate_no_thread(self): |
1102 | 1107 | # https://bitbucket.org/stackless-dev/stackless/issues/92 |
1103 | 1108 | loop = True |
@@ -1257,6 +1262,10 @@ def test_nesting_level(self): |
1257 | 1262 | self.assertIsInstance(l1, int) |
1258 | 1263 |
|
1259 | 1264 | def test_chain(self): |
| 1265 | + # create at least one additional C-stack |
| 1266 | + t = stackless.tasklet(apply_not_stackless)(stackless.main.switch,) |
| 1267 | + t.run() |
| 1268 | + self.addCleanup(t.run) |
1260 | 1269 | start = stackless.main.cstate |
1261 | 1270 | c = start.next |
1262 | 1271 | self.assertIsNot(c, start) |
|
0 commit comments