-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Package not usable with parallel tests #9
Comments
Hi, yes indeed, currently the api is designed to use one mock connection, that could be improved without interfering with the public interface. In meantime, I cannot promise to take a look soon, but if you are working in this area, would be great if you could submit a pull request. cheers |
@jnwhiteh Could you do me a favor and see if my PR would solve your problem? If you are also tackling this issue: what approach did you take? Cheers |
@wongak I added some comments to your pull request, lets continue that discussion there. If useful, I can share the branch I'm working on. |
Thanks for the update! |
There is currently a data race when using go-sqlmock in two tests in parallel due to the way the API is currently designed. There is only ever one "mock" database and all operations are done on this. This means two tests cannot use this package in parallel. This is evidenced from the following data race in a package I am developing. I'm going to take a stab and changing the API to accommodate this.
The text was updated successfully, but these errors were encountered: