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

Add single timeout test #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add single timeout test #17

wants to merge 1 commit into from

Conversation

mxxo
Copy link
Contributor

@mxxo mxxo commented Nov 29, 2019

Add a dedicated test file for single timeouts.

It's currently failing on my machine, but running cargo +nightly test --no-fast-fail I can see that only the timeout test fails.

Maybe this could be an ad-hoc check of which features your kernel supports?

@withoutboats
Copy link
Collaborator

I don't want to merge any tests that will fail on the kernel version I'm currently using to run tests, but I do want to merge this code eventually, so let's leave this PR open for now.

We need a system in which each test can easily specify, if necessary, which minimum kernel version they require. We should not need to go more granular to major.minor, I believe.

Then, we need either: a) a way for users to explicitly pass which version they want to run tests for, or b) a way for tests to receive which kernel they are testing under (by shelling out somehow to uname -r for example).

I expect this can be set up through Rust's #[cfg] attributes (see the cfg_if crate for example of this sort of thing) and cargo features somehow, but I haven't looked into it at all.

This also ties into #6! I haven't even looked into setting up proper CI either instead of running tests myself, I have no idea what kernel support our available CI options will have.

@withoutboats
Copy link
Collaborator

Once we have that system in place we could also consider using it for the APIs as well as the tests, so users will have to explicitly opt into the APIs that require a kernel version greater than whatever a reasonable minimum is (and we would have to set a policy around that as well).

@mxxo
Copy link
Contributor Author

mxxo commented Dec 6, 2019

Right, that sounds like a good plan :)

@mxxo
Copy link
Contributor Author

mxxo commented Jun 11, 2020

way for tests to receive which kernel they are testing under

For future reference, two concrete ways to find the kernel version could be:
https://docs.rs/nix/0.17.0/nix/sys/utsname/struct.UtsName.html
https://docs.rs/cluuname/0.1.9/cluuname/fn.uname.html

These are both "stringily" typed, it would be nice to have a little version number parser abstraction around them.

@mxxo
Copy link
Contributor Author

mxxo commented Sep 23, 2020

I just revised the timeout test to use the 0.3 APIs.

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.

2 participants