-
Notifications
You must be signed in to change notification settings - Fork 703
Description
When running the mqueue tests some of the test queues are left behind
$ ls /dev/mqueue/
$ cargo test test_mq
$ ls /dev/mqueue/
a_nix_test_queue attr_test_get_attr
Some of the queue names are reused so i think there are more than 2 tests that are not cleaning these up.
This is my first interaction with this repo so im not sure if this is a issue or not.
The queues persisting between runs does not seem to cause subsequent runs to fail because any tests that add to the queues also drain them but some of the tests could be simplified by removing the drain code and adding a unlink.
But if a queue already existed with one any of the tests queue names then they might fail in unexpected ways.
We could add O_EXCL to the other flags and then check for EEXIST when we open to provide a helpful error message to avoid confusion.
I could open a MR adding code to ensure all queues are closed (with unlink), add O_EXCL and add a check for EEXIST but if only if it seems useful, i worry that this is just more code for the sake of it, but i also worry about leaving behind things from the tests.