-
Notifications
You must be signed in to change notification settings - Fork 34
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prune dead members on startup #79
Conversation
Pull Request Test Coverage Report for Build 5616199244
馃挍 - Coveralls |
a6b0177
to
0b07e46
Compare
tests/test_unique_queue.py
Outdated
def test_should_prune_dead_members_on_startup(self): | ||
config.prune_dead_members = True | ||
worker = UniqueWorker(server=self.redis, queues=["Detect"]) | ||
|
||
self.redis.sadd("resque:workers", "teste1") | ||
members = self.redis.smembers("resque:workers") | ||
expect(len(members)).to_equal(2) | ||
|
||
worker.startup() | ||
|
||
members = self.redis.smembers("resque:workers") | ||
expect(len(members)).to_equal(1) | ||
expect(str(worker).encode() in members).to_be_true() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we missing a test_should_not_prune_dead_members_on_startup
? I think it's important to check both conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scorphus Makes sense, what do you think of the test?
0b07e46
to
673d4bd
Compare
Code Climate has analyzed commit 673d4bd and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far so good. Expect a couple follow-up PRs from yours truly.
When remotecv is killed in kubernetes/docker the environment stay with dead members instances. So this PR aims to add a prune dead members configuration to avoid this problem.
continuation of #78 馃槵