-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
rust/projects: fix sled test cli_access_server_sled_engine
#279
base: master
Are you sure you want to change the base?
Conversation
The sled test in cli_access_server fails because the second connection attempt is made too fast after killing the first server. Verified with - rustc 1.37 as well as current 1.39.0-nightly (9af17757b 2019-09-02) - in both Project-3 and 4 - and the given example solution and my own implementation System is running Void Linux on a i5-5200U. ``` thread 'main' panicked at 'should be `able` to open configured file at "/tmp/.tmpX9hOJN/db"; IO error: could not acquire appropriate file lock on "/tmp/.tmpX9hOJN/db": Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', /home/suka/.cargo/registry/src/github.com-1ecc6299db9ec823/pagecache-0.19.1/src/config.rs:202:13 ``` Inserting a minimal delay of at least 30ms here solves the issues in all the combinations mentioned above. Other config options in sled itself did not help.
cli_access_server_sled_engine
Thanks for the patch and sorry for not reviewing earlier @frobiac. I'd rather not add sleeps to fix broken tests. The correct way to fix this is to hook into some event before continuing the test. If that's not feasible then let's just |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per previous comment.
Hi @brson, I was able to solve this problem by installing sled in the dev-dependencies section as: sled = { version = "0.31.0", features = ["testing"] } Does this make sense? On the other hand, I don't get that error here in project-3 but I get that in mine. |
@morenol thanks for the suggestion. On closer inspection, I see the tests are already filled with sleeps :( This is not a practice I want to endorse in this course! Offhand I don't see why putting That said, simply upgrading sled would be a good idea. I'm sure it's had a lot of bug fixes, and I'd be happy to take a patch that does the upgrade. When I look at the test that is failing, what I suspect is happening is that the tests are not properly waiting for the first server process to exit. The kill docs don't say they wait for exit, just that they send the kill signal. So I think the tests should probably be changed such that every Do you mind trying that and seeing if it fixes this bug? |
I meet the same issue, are there any update? |
The sled test in cli_access_server fails because the second connection attempt
is made too fast after killing the first server.
Verified with
System is running Void Linux on a i5-5200U.
Inserting a minimal delay of at least 30ms here solves the issues in all the
combinations mentioned above. Other config options in sled itself did not help.