-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Per test timeout #71
Per test timeout #71
Conversation
I like the overall approach. Couple of notes:
|
I'm wondering if perhaps this should remove the It might feel a bit odd to have tow PR's removing each other 😂 but for the sake of version progression (breaking vs non breaking changes in semver) it does make some sense to have #70 as a non breaking change, and then this as a breaking change moving more into the direction that reflects the vision of where things are going. On the other hand there was a thought behind making it not error, mainly it allows a feature flag to quickly toggle timeouts on and off for testing with various settings, but I can totally see how hat is confusing. |
I think the But, back to the topic, yes, I think it makes sense to remove it. Going back to a "no timeouts" default, while permitting it getting added on a test-by-test basis is good. I suspect practically no-one uses the feature as it is released right now, and if they do, they can either not upgrade or switch to the new syntax. Also, that timeouts doesn't need any extra crates kinda leans me towards "support it for everyone". |
7d0a595
to
109b73d
Compare
How's this going @Licenser? Any thoughts on timelines for this one? |
Heya, sorry about that, I got sidetracked with 1000 other things and ended up sick the last few days :) should be able to wrap this up today or worst this week :) |
3b97657
to
c1f9034
Compare
There we go, just needed to clean up the file_lock part. It didn't support timeouts in the past and I kept it this way but added the plumbing to add it later on if it's ever desired :). |
I'm happy with the implementation. It still needs docs adding for it, and at least one or two integration tests (i.e. actual uses of Thanks! |
Tried adding some tests to
and got the error |
Darn it, I'm sorry I didn't even notice that sub project -.-, my bad, should be fixed now :) |
f673797
to
a40be1f
Compare
I'm confused why the tests fail at this point, I don't see a correlation to the changed code, and I can't reproduce the failures locally. |
Not sure. I also can't reproduce the failures locally. Possibly try bumping the timeouts to 60s just in case? |
a40be1f
to
0c02efa
Compare
Giving that a shot :) |
So I'm pretty sure I know what's wrong. There's a set of tests What I think is happening is that somewhere in the We could fix this PR by just upping the I'll prod at this on a new branch, but it's one of those cases that's a pain to test... |
I think that #72 which redoes things with |
8df972e
to
2993414
Compare
I just removed the timeouts from the functions to see if the tests still fail, it looks "promising" (as in while writing this the tests are still going and not finishing). At least that's a good indication that the timeouts are not what's being off but that the breakage is linked to the number of tests - which would validate your theory. Reading The read_lock to check if the name is present and the write lock for inserting the name are done separately. L69 locks for reads, checks if the key is present, if not, it drops the lock in L74. In L80 it tries to take the write lock. I could see two threads slipping past the read lock and reaching the waiting for the write lock at the same time, but with The second thing I noticed during digging is that the timeout is only counted for how long to wait until we can enter insert into the map, not how long the test runs or am I totally misunderstanding the check_key function? |
I agree, there is no hurry to get this merged from my side, lets keep this as broken for now the hang is a bigger concern then the timeout attribute :) |
Correct. The ideal situation would be some sort of "read lock with possible upgrade to write" and most of those seem to lock it down to just one getting upgraded. The logic as it is assumes that multiple threads may indeed slip past the read lock. Only one should then get the write lock but there was some hard to test scenarios that seem to avoid this, so hence the default bits.
Correct. It's original purpose was to try and catch deadlock scenarios. |
To clarify: I didn't use those, as they all seemed to then cause other issues. I can't recall what offhand, but fundamentally I couldn't figure out how to use them, so this simpler setup was used. |
I've merged this now. Can you resolve the conflicts here and let's see if it's still running clean and then let's get it merged. |
On it, fingers crossed :) |
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
2ab41ed
to
2a4dca2
Compare
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
2a4dca2
to
d416977
Compare
It passed! Great call on the |
Released as part of 0.9.0 |
So this is still a draft, it adds the option to define a timeout as part of the serial test something along the lines of:
I've not added tests or documentation yet as I wanted to get feedback on if this approach is OK before putting in that work :)