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

[5.0] make resource monitor plugin tests deterministic by using fixed fc::temp_directory instead of dynamic /tmp #1826

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

linh2931
Copy link
Member

Several resource monitor plugin tests use native /tmp as a monitored directory for testing. However, subdirectories in /tmp on test machine can be removed during a test run, causing file_space_handler::add_file_system to assert when doing get_stat on a removed directory, as shown by following failure:

/__w/leap/leap/plugins/resource_monitor_plugin/test/test_resmon_plugin.cpp(147): fatal error: in "resmon_plugin_tests/startupNormal": unexpected exception thrown by plugin_startup({"/tmp"})

I manually simulated a removed directory and reproduced the same failure.

This PR

  • uses a fixed temp directory provided by fc::temp_directory instead of /tmp.
  • removes a non-necessary no-value provided test.

Resolves #1824

fc::temp_directory instead of dynamic /tmp
@heifner heifner linked an issue Oct 26, 2023 that may be closed by this pull request
@linh2931 linh2931 merged commit fcb6525 into release/5.0 Oct 26, 2023
29 checks passed
@linh2931 linh2931 deleted the resmon_deterministic_tests branch October 26, 2023 17:01
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.

Test Failure: test_resmon_plugin
3 participants