Skip to content

Commit b832adc

Browse files
author
Anselm Kruis
committed
Stackless issue python#99: Minor improvements of the test suite
- Fix "make teststackless". Previously it required a non standard shell. - Make test_thread more robust. Some tests used to fail on medium loaded systems. https://bitbucket.org/stackless-dev/stackless/issues/99 (grafted from d2576f5dd2082d20ebba7206fa0dc3f4bd477aa1)
1 parent e01bb16 commit b832adc

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ testall: all platform
918918
$(TESTRUNNER) -u all $(TESTOPTS)
919919

920920
teststackless: all platform
921-
pushd Stackless/unittests; $(RUNSHARED) ../../$(BUILDPYTHON) -E -tt runAll.py; popd
921+
$(TESTPYTHON) Stackless/unittests/runAll.py
922922

923923
# Run the test suite for both architectures in a Universal build on OSX.
924924
# Must be run on an Intel box.

Stackless/changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ What's New in Stackless 3.X.X?
99

1010
*Release date: 20XX-XX-XX*
1111

12+
- https://bitbucket.org/stackless-dev/stackless/issues/99
13+
On UNIX like systems you can use the command
14+
$ make teststackless
15+
to run the Stackless unit tests. Previously the command required some non
16+
POSIX commands.
17+
1218
- https://bitbucket.org/stackless-dev/stackless/issues/97
1319
Fix the stack switching for optimized builds for all Unix-like architectures
1420
except amd64, where it was already OK. This change removes the "static"

Stackless/unittests/test_thread.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def linger(self):
8282

8383
def join(self):
8484
self.shutdown.set()
85-
return super(LingeringThread, self).join()
85+
super(LingeringThread, self).join()
86+
time.sleep(0.01) # give the thread a chance to clean up
8687

8788
def __enter__(self):
8889
pass
@@ -351,6 +352,7 @@ def test_tasklet_from_dead_thread(self):
351352
theThread, t = self.create_thread_task()
352353
self.assertTrue(t.alive)
353354
theThread.join()
355+
time.sleep(0.01) # give the thread a short time to clean up
354356
# now the tasklet should have been killed.
355357
self.assertFalse(t.alive)
356358

@@ -360,6 +362,7 @@ def test_removed_tasklet_from_dead_thread(self):
360362
t.remove()
361363
self.assertFalse(t.scheduled)
362364
theThread.join()
365+
time.sleep(0.01) # give the thread a short time to clean up
363366
# now the tasklet should have been killed.
364367
self.assertFalse(t.alive)
365368

0 commit comments

Comments
 (0)