Skip to content

Commit

Permalink
Stackless issue python#99: Minor improvements of the test suite
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
Anselm Kruis committed Nov 12, 2016
1 parent e01bb16 commit b832adc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ testall: all platform
$(TESTRUNNER) -u all $(TESTOPTS)

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

# Run the test suite for both architectures in a Universal build on OSX.
# Must be run on an Intel box.
Expand Down
6 changes: 6 additions & 0 deletions Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ What's New in Stackless 3.X.X?

*Release date: 20XX-XX-XX*

- https://bitbucket.org/stackless-dev/stackless/issues/99
On UNIX like systems you can use the command
$ make teststackless
to run the Stackless unit tests. Previously the command required some non
POSIX commands.

- https://bitbucket.org/stackless-dev/stackless/issues/97
Fix the stack switching for optimized builds for all Unix-like architectures
except amd64, where it was already OK. This change removes the "static"
Expand Down
5 changes: 4 additions & 1 deletion Stackless/unittests/test_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def linger(self):

def join(self):
self.shutdown.set()
return super(LingeringThread, self).join()
super(LingeringThread, self).join()
time.sleep(0.01) # give the thread a chance to clean up

def __enter__(self):
pass
Expand Down Expand Up @@ -351,6 +352,7 @@ def test_tasklet_from_dead_thread(self):
theThread, t = self.create_thread_task()
self.assertTrue(t.alive)
theThread.join()
time.sleep(0.01) # give the thread a short time to clean up
# now the tasklet should have been killed.
self.assertFalse(t.alive)

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

Expand Down

0 comments on commit b832adc

Please sign in to comment.