mesalock-linux / mesabox

A collection of core system utilities written in Rust for Unix-like systems (and now Windows)
BSD 3-Clause "New" or "Revised" License
137 stars 19 forks source link

CI/Testing issues #3

Closed Arcterus closed 6 years ago

Arcterus commented 6 years ago

test_chmod::test_chmod_ugoa seems to fail sometimes on Rust 1.26 for some reason. Additionally, the sleep tests can easily fail if the system takes too long to wake from sleep (or if threads take too long to spawn).

mssun commented 6 years ago

Hmmm... interesting.

I cannot reproduce the sleep CI issue by using this command (should be similar with drone CI):

$ docker run -v $(pwd):/mesabox -w /mesabox -it rustlang/rust:nightly /bin/bash -c "cargo test"
mssun commented 6 years ago

After upgrading the CI machine (starting use SSD), the CI is fast enough. The test can pass now (https://ci.mesalock-linux.org/mesalock-linux/mesabox/30).

test_chmod::test_chmod_ugoa seems to fail sometimes on Rust 1.26 for some reason.

Do you know what cause it failed? Should we investigate this problem?

Arcterus commented 6 years ago

The problem is that thread::sleep() provides no guarantees about how long it actually sleeps (and we are spawning a thread in the test, which wastes some time). I don't really think it's an issue (you probably shouldn't rely on the utility version of sleep being super accurate either), but we may want to tune the test so it doesn't fail so often.

mssun commented 6 years ago

This issue is mitigated by relaxing the sleep diff.