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

Occasional race condition with tests subpackage #11

Closed
influx6 opened this issue Feb 20, 2016 · 2 comments
Closed

Occasional race condition with tests subpackage #11

influx6 opened this issue Feb 20, 2016 · 2 comments

Comments

@influx6
Copy link
Contributor

influx6 commented Feb 20, 2016

I have noticed a number of times in use of the Kit tests subpackage that there exists a race when using tests.ResetLog() and tests.DisplayLog(), especially when parrallel tests are allowed, we need to wrap those calls with mutex to avoid such a case.

@ardan-bkennedy
Copy link
Contributor

This does not really solve the problem. Running Test functions in parallel will still require tests to be sharing the same buffer, which is not what we want. We use the ./... to run package tests in parallel but this was not designed to run test function within a package in parallel. I'm not sure we want or need to support that. Let's talk.

@ardan-bkennedy
Copy link
Contributor

This will not solve the problem you wish to solve. The log package acts as a singleton and this code supports that assumption per package. If you want to run test functions in parallel inside a package, you will need a TestMain and call these functions once.

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

No branches or pull requests

2 participants