Shutdown tests unintentionally sleep for 10 seconds
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start in test/functional/master/test_shutdown.py and trace self.cluster.block_until_n_slaves_dead through poll.wait_for. Check how are_slaves_dead() reports completion and how the call's result is handled. Done means the shutdown tests still cover the flaky scenario without unconditionally waiting 10 seconds, with the relevant test behavior verified.
Written by the indexing model from the issue text.
Description
Some of the tests in test/functional/master/test_shutdown.py do this at the end of the test:
self.cluster.block_until_n_slaves_dead(2, 10)
The block_until_n_slaves_dead method does this:
def block_until_n_slaves_dead(self, num_slaves, timeout):
...
def are_slaves_dead():
are_n_slaves_dead(num_slaves)
slaves_died_within_timeout = poll.wait_for(are_slaves_dead, timeout_seconds=timeout)
...
The problem is that that are_slaves_dead() function doesn't return anything (so it always returns None). That makes the poll.wait_for call always take the full 10 seconds. (There is a separate issue in that the return value from the self.cluster.block_until_n_slaves_dead(2, 10) call is not asserted on which would have also caught this issue.)
From the git history it looks like these calls were added to address a flaky test in #174, so that indicates that some amount of sleep is necessary, but not the whole 10 seconds.
- Dominant language
- Python
- Stars
- 184
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from box/ClusterRunner
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
box/ClusterRunner#150 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
box/ClusterRunner#457 · 2 comments ·
-
major
Difficulty 5/5 Over a week Newbie friendliness 25/100
box/ClusterRunner#433 · 4 comments · 48 reactions ·
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
box/ClusterRunner#411 · 1 comment ·
-
Update Pylint Openhelp wanted
Difficulty 3/5 1-2 days Newbie friendliness 35/100
box/ClusterRunner#395 · 1 comment · 2 reactions ·
All issues in box/ClusterRunner
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100