Make docstring style more consistent

This commit is contained in:
Ran Benita
2024-04-03 00:15:21 +03:00
parent e3b69d4f29
commit c01de1c73e
15 changed files with 64 additions and 71 deletions

View File

@@ -4,7 +4,7 @@ from xdist.workermanage import parse_spec_config
class EachScheduling:
"""Implement scheduling of test items on all nodes
"""Implement scheduling of test items on all nodes.
If a node gets added after the test run is started then it is
assumed to replace a node which got removed before it finished
@@ -48,7 +48,7 @@ class EachScheduling:
@property
def has_pending(self):
"""Return True if there are pending test items
"""Return True if there are pending test items.
This indicates that collection has finished and nodes are
still processing test items, so this can be thought of as
@@ -64,7 +64,7 @@ class EachScheduling:
self.node2pending[node] = []
def add_node_collection(self, node, collection):
"""Add the collected test items from a node
"""Add the collected test items from a node.
Collection is complete once all nodes have submitted their
collection. In this case its pending list is set to an empty
@@ -119,7 +119,7 @@ class EachScheduling:
return crashitem
def schedule(self):
"""Schedule the test items on the nodes
"""Schedule the test items on the nodes.
If the node's pending list is empty it is a new node which
needs to run all the tests. If the pending list is already

View File

@@ -23,7 +23,7 @@ class LoadScheduling:
submit a collection. This is used to know when all nodes have
finished collection or how large the chunks need to be created.
Attributes:
Attributes::
:numnodes: The expected number of nodes taking part. The actual
number of nodes will vary during the scheduler's lifetime as
@@ -95,7 +95,7 @@ class LoadScheduling:
@property
def has_pending(self):
"""Return True if there are pending test items
"""Return True if there are pending test items.
This indicates that collection has finished and nodes are
still processing test items, so this can be thought of as
@@ -121,7 +121,7 @@ class LoadScheduling:
self.node2pending[node] = []
def add_node_collection(self, node, collection):
"""Add the collected test items from a node
"""Add the collected test items from a node.
The collection is stored in the ``.node2collection`` map.
Called by the ``DSession.worker_collectionfinish`` hook.
@@ -142,7 +142,7 @@ class LoadScheduling:
self.node2collection[node] = list(collection)
def mark_test_complete(self, node, item_index, duration=0):
"""Mark test item as completed by node
"""Mark test item as completed by node.
The duration it took to execute the item is used as a hint to
the scheduler.
@@ -161,7 +161,7 @@ class LoadScheduling:
self.check_schedule(node)
def check_schedule(self, node, duration=0):
"""Maybe schedule new items on the node
"""Maybe schedule new items on the node.
If there are any globally pending nodes left then this will
check if the given node should be given any more tests. The
@@ -195,7 +195,7 @@ class LoadScheduling:
self.log("num items waiting for node:", len(self.pending))
def remove_node(self, node):
"""Remove a node from the scheduler
"""Remove a node from the scheduler.
This should be called either when the node crashed or at
shutdown time. In the former case any pending items assigned
@@ -219,7 +219,7 @@ class LoadScheduling:
return crashitem
def schedule(self):
"""Initiate distribution of the test collection
"""Initiate distribution of the test collection.
Initiate scheduling of the items across the nodes. If this
gets called again later it behaves the same as calling

View File

@@ -44,7 +44,10 @@ class LoadFileScheduling(LoadScopeScheduling):
This function will group tests with the scope determined by splitting
the first ``::`` from the left. That is, test will be grouped in a
single work unit when they reside in the same file.
In the above example, scopes will be::
In the above example, scopes will be::
.. code-block:: text
example/loadsuite/test/test_beta.py
example/loadsuite/test/test_delta.py

View File

@@ -22,7 +22,7 @@ class LoadScopeScheduling:
When created, ``numnodes`` defines how many nodes are expected to submit a
collection. This is used to know when all nodes have finished collection.
Attributes:
Attributes::
:numnodes: The expected number of nodes taking part. The actual number of
nodes will vary during the scheduler's lifetime as nodes are added by

View File

@@ -22,7 +22,7 @@ class WorkStealingScheduling:
test remains), an attempt is made to reassign ("steal") some tests from
other nodes to this node.
Attributes:
Attributes::
:numnodes: The expected number of nodes taking part. The actual
number of nodes will vary during the scheduler's lifetime as
@@ -101,7 +101,7 @@ class WorkStealingScheduling:
@property
def has_pending(self):
"""Return True if there are pending test items
"""Return True if there are pending test items.
This indicates that collection has finished and nodes are
still processing test items, so this can be thought of as
@@ -127,7 +127,7 @@ class WorkStealingScheduling:
self.node2pending[node] = []
def add_node_collection(self, node, collection):
"""Add the collected test items from a node
"""Add the collected test items from a node.
The collection is stored in the ``.node2collection`` map.
Called by the ``DSession.worker_collectionfinish`` hook.
@@ -148,7 +148,7 @@ class WorkStealingScheduling:
self.node2collection[node] = list(collection)
def mark_test_complete(self, node, item_index, duration=None):
"""Mark test item as completed by node
"""Mark test item as completed by node.
This is called by the ``DSession.worker_testreport`` hook.
"""
@@ -233,7 +233,7 @@ class WorkStealingScheduling:
self.steal_requested_from_node = steal_from.node
def remove_node(self, node):
"""Remove a node from the scheduler
"""Remove a node from the scheduler.
This should be called either when the node crashed or at
shutdown time. In the former case any pending items assigned
@@ -263,7 +263,7 @@ class WorkStealingScheduling:
return crashitem
def schedule(self):
"""Initiate distribution of the test collection
"""Initiate distribution of the test collection.
Initiate scheduling of the items across the nodes. If this
gets called again later it behaves the same as calling