add CHANGELGOG, and make "-x" work harder to shut down immediately.

This commit is contained in:
holger krekel
2010-01-18 13:49:35 +01:00
parent 4594e5dbd8
commit b8ea732fb0
5 changed files with 30 additions and 7 deletions

11
CHANGELOG Normal file
View File

@@ -0,0 +1,11 @@
1.0
-------------------------
- moved code out of py-1.1.1 into its own plugin
- use a new, faster and more sensible model to do load-balancing
of tests - now no magic "MAXITEMSPERHOST" is needed and load-testing
works effectively even with very few tests.
- cleaned up termination handling
- make -x cause hard killing of test nodes to decrease wait time
until the traceback shows up on first failure

View File

@@ -20,7 +20,7 @@ setup(
packages = ['xdist'], packages = ['xdist'],
entry_points = {'pytest11': ['xdist = xdist.plugin'],}, entry_points = {'pytest11': ['xdist = xdist.plugin'],},
zip_safe=False, zip_safe=False,
install_requires = ['execnet', 'py>=1.2.0'], install_requires = ['execnet>=1.0.3', 'py>=1.2.0'],
classifiers=[ classifiers=[
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
'Intended Audience :: Developers', 'Intended Audience :: Developers',

View File

@@ -266,9 +266,10 @@ class TestDSession:
session.queueevent("pytest_runtest_logreport", report=ev2) session.queueevent("pytest_runtest_logreport", report=ev2)
# now call the loop # now call the loop
loopstate = session._initloopstate(items) loopstate = session._initloopstate(items)
session.loop_once(loopstate) from xdist.dsession import ExitFirstInterrupt
py.test.raises(ExitFirstInterrupt, "session.loop_once(loopstate)")
assert loopstate.testsfailed assert loopstate.testsfailed
assert loopstate.shuttingdown #assert loopstate.shuttingdown
def test_shuttingdown_filters(self, testdir): def test_shuttingdown_filters(self, testdir):
item = testdir.getitem("def test_func(): pass") item = testdir.getitem("def test_func(): pass")

View File

@@ -57,6 +57,9 @@ class LoopState(object):
self.colitems[:] = items + self.colitems self.colitems[:] = items + self.colitems
self.dowork = False # avoid busywait self.dowork = False # avoid busywait
class ExitFirstInterrupt(KeyboardInterrupt):
pass
class DSession(Session): class DSession(Session):
""" """
Session drives the collection and running of tests Session drives the collection and running of tests
@@ -129,6 +132,8 @@ class DSession(Session):
# termination conditions # termination conditions
if ((loopstate.testsfailed and self.config.option.exitfirst) or if ((loopstate.testsfailed and self.config.option.exitfirst) or
(not self.item2nodes and not colitems and not self.queue.qsize())): (not self.item2nodes and not colitems and not self.queue.qsize())):
if self.config.option.exitfirst:
raise ExitFirstInterrupt()
self.triggershutdown() self.triggershutdown()
loopstate.shuttingdown = True loopstate.shuttingdown = True
elif not self.node2pending: elif not self.node2pending:
@@ -174,6 +179,9 @@ class DSession(Session):
break break
except KeyboardInterrupt: except KeyboardInterrupt:
excinfo = py.code.ExceptionInfo() excinfo = py.code.ExceptionInfo()
if excinfo.errisinstance(ExitFirstInterrupt):
exitstatus = outcome.EXIT_TESTSFAILED
else:
self.config.hook.pytest_keyboard_interrupt(excinfo=excinfo) self.config.hook.pytest_keyboard_interrupt(excinfo=excinfo)
exitstatus = outcome.EXIT_INTERRUPTED exitstatus = outcome.EXIT_INTERRUPTED
except: except:

View File

@@ -74,7 +74,10 @@ class TXNode(object):
def sendlist(self, itemlist): def sendlist(self, itemlist):
self.channel.send(itemlist) self.channel.send(itemlist)
def shutdown(self): def shutdown(self, kill=False):
if kill:
self.gateway.exit()
else:
self.channel.send(None) self.channel.send(None)
# setting up slave code # setting up slave code