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

issue #513: allow stop when not started #514

Merged

Conversation

ColinDKelley
Copy link
Collaborator

@ColinDKelley ColinDKelley commented Nov 13, 2020

Fix issue #513 .

This issue wasn't being caught by the unit tests because they stub the processor entirely. So I added a couple tests to acceptance_test.

Note: I changed the indentation to add a new context, so this is best reviewed with "hide whitespace changes".

spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
spec/acceptance/listen_spec.rb Show resolved Hide resolved
@@ -67,7 +67,7 @@ def stop
return if stopped?
transition! :stopped

if @wait_thread.alive?
if @wait_thread&.alive?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feeback from @ioquatix

I think you can just do @wait_thread.join
the if statement, is a race condition

True! And building on that, the return if stopped? is a race condition too. I'm getting rid of both, in favor of simply @wait_thread&.join.

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

Successfully merging this pull request may close these issues.

None yet

3 participants