From 4ed8161ef808f04d1b16ab65066fe556acbbff1a Mon Sep 17 00:00:00 2001 From: Michael Elovskikh Date: Wed, 15 Feb 2017 23:54:23 +0500 Subject: [PATCH] Renamed scheduller remove_item method to mark_test_complete --- testing/test_dsession.py | 10 +++++----- xdist/dsession.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testing/test_dsession.py b/testing/test_dsession.py index a5ec76f..5de6c50 100644 --- a/testing/test_dsession.py +++ b/testing/test_dsession.py @@ -68,9 +68,9 @@ class TestEachScheduling: assert sched.tests_finished assert node1.sent == ['ALL'] assert node2.sent == ['ALL'] - sched.remove_item(node1, 0) + sched.mark_test_complete(node1, 0) assert sched.tests_finished - sched.remove_item(node2, 0) + sched.mark_test_complete(node2, 0) assert sched.tests_finished def test_schedule_remove_node(self, testdir): @@ -113,7 +113,7 @@ class TestLoadScheduling: assert len(node2.sent) == 1 assert node1.sent == [0] assert node2.sent == [1] - sched.remove_item(node1, node1.sent[0]) + sched.mark_test_complete(node1, node1.sent[0]) assert sched.tests_finished def test_schedule_batch_size(self, testdir): @@ -135,11 +135,11 @@ class TestLoadScheduling: assert sched.node2pending[node1] == sent1 assert sched.node2pending[node2] == sent2 assert len(sched.pending) == 2 - sched.remove_item(node1, 0) + sched.mark_test_complete(node1, 0) assert node1.sent == [0, 2, 4] assert sched.pending == [5] assert node2.sent == [1, 3] - sched.remove_item(node1, 2) + sched.mark_test_complete(node1, 2) assert node1.sent == [0, 2, 4, 5] assert not sched.pending diff --git a/xdist/dsession.py b/xdist/dsession.py index 6c3dd70..9ddbc2d 100644 --- a/xdist/dsession.py +++ b/xdist/dsession.py @@ -102,7 +102,7 @@ class EachScheduling: self.node2pending[node] = pending break - def remove_item(self, node, item_index, duration=0): + def mark_test_complete(self, node, item_index, duration=0): self.node2pending[node].remove(item_index) def remove_node(self, node): @@ -143,7 +143,7 @@ class LoadScheduling: when all collections are received it is verified they are identical collections. Then the collection gets divided up in chunks and chunks get submitted to nodes. Whenever a node finishes - an item, it calls ``.remove_item()`` which will trigger the + an item, it calls ``.mark_test_complete()`` which will trigger the scheduler to assign more tests if the number of pending tests for the node falls below a low-watermark. @@ -269,7 +269,7 @@ class LoadScheduling: return self.node2collection[node] = list(collection) - def remove_item(self, node, item_index, duration=0): + def mark_test_complete(self, node, item_index, duration=0): """Mark test item as completed by node The duration it took to execute the item is used as a hint to @@ -661,7 +661,7 @@ class DSession: the item from the pending list in the scheduler. """ if rep.when == "call" or (rep.when == "setup" and not rep.passed): - self.sched.remove_item(node, rep.item_index, rep.duration) + self.sched.mark_test_complete(node, rep.item_index, rep.duration) # self.report_line("testreport %s: %s" %(rep.id, rep.status)) rep.node = node self.config.hook.pytest_runtest_logreport(report=rep)