box / box/ClusterRunner

Shutdown tests unintentionally sleep for 10 seconds

Open
#336 0 comments 0 reactions 0 assignees View on GitHub
bug minor
Dominant language
Python
Stars
184
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Some of the tests in `test/functional/master/test_shutdown.py` do this at the end of the test:
```python
self.cluster.block_until_n_slaves_dead(2, 10)
```

The `block_until_n_slaves_dead` method does this:
```python
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.