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

Fix all reports from go test -race in weavedns unit tests #935

Merged
merged 7 commits into from Jun 17, 2015

Conversation

bboreham
Copy link
Contributor

Most are artefacts of the test code, but having so many reports made it difficult to check for any real problems.

The only one which looks like a real problem is a34d2ec, though aa85e19 could conceivably result in a crash.

@rade
Copy link
Member

rade commented Jun 16, 2015

linter is unhappy.

@inercia inercia assigned bboreham and unassigned inercia Jun 16, 2015
@rade
Copy link
Member

rade commented Jun 17, 2015

@inercia aside from the linter issue, are you happy with the rest?

select {
case action := <-actionChan:
if action == nil {
c.listener.Shutdown()
c.running = false
return

This comment was marked as abuse.

This comment was marked as abuse.

@inercia
Copy link
Contributor

inercia commented Jun 17, 2015

@rade I've added a couple of comments....

@bboreham bboreham assigned inercia and unassigned bboreham Jun 17, 2015
@inercia inercia assigned bboreham and unassigned inercia Jun 17, 2015
The shuffleAnswers() call ends up acting on the same data,
so it seems simplest to resolve ownership arguments by copying.
This avoids race-conditions in unit tests where the initialisation
is on a different goroutine to the logging.
Specifically, move the part that blocks, and call that as necessary.
This means Start() can run on the caller's goroutine and avoid race conditions.
@bboreham
Copy link
Contributor Author

I re-did the last commit with an ActivateAndServe() method, and rebased the commits to remove detours.

@bboreham bboreham assigned inercia and unassigned bboreham Jun 17, 2015
@inercia
Copy link
Contributor

inercia commented Jun 17, 2015

Thanks, @bboreham, it looks great now! Everything looks good to me now. Please merge it if all tests pass...

@inercia inercia assigned bboreham and unassigned inercia Jun 17, 2015
bboreham added a commit that referenced this pull request Jun 17, 2015
All unit and smoke tests passed.
@bboreham bboreham merged commit 34e0e3b into weaveworks:master Jun 17, 2015
@rade rade added this to the 1.0.0 milestone Jun 17, 2015
@rade rade added this to the 1.0.0 milestone Jun 17, 2015
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