Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown tests unintentionally sleep for 10 seconds #336

Open
josephharrington opened this issue May 9, 2017 · 0 comments
Open

Shutdown tests unintentionally sleep for 10 seconds #336

josephharrington opened this issue May 9, 2017 · 0 comments

Comments

@josephharrington
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants