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

Possible fix for racy sql testkit specs #2484

Merged
merged 3 commits into from
Jan 26, 2017
Merged

Possible fix for racy sql testkit specs #2484

merged 3 commits into from
Jan 26, 2017

Conversation

Danthar
Copy link
Member

@Danthar Danthar commented Jan 25, 2017

As i have discovered before. XUnit in combination with the akka TestKit causes some wierd stuff sometimes.
One thing that happens is that state you expect to be reinitialized for each test is sometimes reused between tests.

Reference to where i encountered a similar case: http://stackoverflow.com/questions/40767924/testing-behavior-not-consistent-when-watching-actor-for-termination/40929659#40929659

What this PR does, is move the SqlReadJournal reference to the local scope. Thereby eliminating any chance there is concurrent access to that resource where its not expected.

The EventsByTagSpec might need more refactoring. But worked consistently locally on the SqlLite tests implementation whereas before are very racy.

@Danthar
Copy link
Member Author

Danthar commented Jan 25, 2017

This might also help solve issues with: akkadotnet/Akka.Persistence.SqlServer#56

@Horusiath
Copy link
Contributor

If it works I'm all for it :) My only remark is to keep up with conventions - if _queries are local now, there's no need to have underscore prefix.

@Aaronontheweb
Copy link
Member

@Danthar would you make those style changes that @Horusiath suggested?

@Danthar
Copy link
Member Author

Danthar commented Jan 25, 2017

Sure thing. First thing tomorrow.

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.

3 participants