Skip to content

Commit 594ba7a

Browse files
committed
Revert "New solution that does not require change to dsession"
This reverts commit c7a19c3.
1 parent 3659a3b commit 594ba7a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/xdist/dsession.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def worker_workerfinished(self, node):
182182
self.shouldstop = f"{node} received keyboard-interrupt"
183183
self.worker_errordown(node, "keyboard-interrupt")
184184
return
185-
if node in self.sched.nodes:
185+
if not self.shouldstop and node in self.sched.nodes:
186186
crashitem = self.sched.remove_node(node)
187187
assert not crashitem, (crashitem, node)
188188
self._active_nodes.remove(node)

src/xdist/remote.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,12 @@ def pytest_runtestloop(self, session):
154154
self.channel.setcallback(self.handle_command, endmarker=self.SHUTDOWN_MARK)
155155
self.nextitem_index = self._get_next_item_index()
156156
while self.nextitem_index is not self.SHUTDOWN_MARK:
157-
self.run_one_test(session.shouldfail or session.shouldstop)
157+
self.run_one_test()
158+
if session.shouldfail or session.shouldstop:
159+
break
158160
return True
159161

160-
def run_one_test(self, skip: bool):
162+
def run_one_test(self):
161163
self.item_index = self.nextitem_index
162164
self.nextitem_index = self._get_next_item_index()
163165

@@ -171,10 +173,7 @@ def run_one_test(self, skip: bool):
171173
worker_title("[pytest-xdist running] %s" % item.nodeid)
172174

173175
start = time.time()
174-
175-
if not skip:
176-
self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
177-
176+
self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
178177
duration = time.time() - start
179178

180179
worker_title("[pytest-xdist idle]")

0 commit comments

Comments
 (0)