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

nightly test polish #1665

Merged
merged 22 commits into from
Mar 17, 2025
Merged

nightly test polish #1665

merged 22 commits into from
Mar 17, 2025

Conversation

leftwo
Copy link
Contributor

@leftwo leftwo commented Mar 6, 2025

Updates to the nightly tests and the tests it calls.

All the nightly tests have their own named directory for test logs

WORK_ROOT=${WORK_ROOT:-/tmp}
TEST_ROOT="$WORK_ROOT/<test_name>"

This makes cleanup at the end easier.
In all tests, dsc now logs to this or a specified directory.

All the nightly tests now have a REGION_ROOT, and this is where dsc or the crucible downstairs will create region directories. This makes it easier for the caller to direct the tests to use a specific location instead of everyone piling in to /var/tmp

If a test finishes without error, it will clean up logs and regions that were created as part of the test. If there is an error, then we leave things behind. We clean up the contents of REGION_ROOT but only what each test creates itself.

Updated tools/test_nightly.sh to print the name of the test it is running, and just cleaned up the output a bit.

@leftwo leftwo requested review from jmpesp and mkeeter March 6, 2025 20:08
rm -r "$REGION_ROOT"/8810
rm -r "$REGION_ROOT"/8820
rm -r "$REGION_ROOT"/8830
# If empty, remove the region directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there cases where this wouldn't be empty? If not, should we do rm -r "$REGION_ROOT" versus deleting region dirs individually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what I want here was something I don't think this is going to give me, and you are
right to call out what this half measure was doing.

What I want is for the caller to be able to supply a directory and have this (and any
other tests) use that directory as a place where the regions are created.
The problem arises if that directory is not empty. I don't want this test to blindly
destroy whatever exists. My half measure was to only remove directories that I
knew this tests created.

However, I now think a better solution is to, like we do with TEST_ROOT, is to create
a specific subdirectory inside REGION_ROOT, and put all region directories inside that.

This way I can always remove $REGION_ROOT/<my_test_unique_subdir> and not have
to care what is in that directory, or even know what exact directories exist inside it, which
will be a problem when I make these tests have multiple region sets.

I'll refactor this and all the places where we use REGION_ROOT

@@ -42,7 +42,7 @@ else
rm -r "$TEST_ROOT"
fi
REGION_ROOT=${REGION_ROOT:-/var/tmp}
MY_REGION_ROOT=${REGION_ROOT/hammer_loop}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, and should be MY_REGION_ROOT=${REGION_ROOT}/hammer_loop
Should be fixed in newer commits.

@leftwo leftwo requested a review from mkeeter March 17, 2025 14:56
@leftwo leftwo merged commit 29fe18b into main Mar 17, 2025
17 checks passed
@leftwo leftwo deleted the alan/nightly-test-polish branch March 17, 2025 22:26
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