Skip to content

Several mqueue tests do not clean up there queues #2649

@wsalmonct

Description

@wsalmonct

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions