Repository navigation
Conversation
Eight pairs of tests used the same file name, and TestNG runs some of them back to back. On Windows a file can't be deleted while another process (e.g. a virus scanner looking at the freshly written file) still has it open, so the second test's delete() could fail silently and its assertFalse(file.exists()) fail. testMDShortArrayRankMismatchDetached failed this way on a Windows CI run. Every test now uses a file name no other test uses; no test relied on another's file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #14.
Problem
In a Windows run against a #1814 build of the HDF5 preset (run 37877788908),
HDF5RoundtripTest.testMDShortArrayRankMismatchDetachedfailed with:Line 3444 is
assertFalse(shortArrayFile.exists()), right aftershortArrayFile.delete(), so the test failed before it touched HDF5. The same code passed in two earlier Windows runs.testMDShortArrayRankMismatchruns just before it and writes the same file,MDShortArrayRankMismatch.h5. On Windows a file can't be deleted while any process still holds it open. A virus scanner briefly opening the freshly written file is enough, andFile.delete()then returnsfalsewithout an error. No HDF5 handle was involved: the test's owngetOpenHDF5FileCount() == 0check, just before it, passed.Fix
Eight pairs of tests in
HDF5RoundtripTestshared a file name. The second test of each pair now gets its own:testMDShortArrayRankMismatchDetachedMDShortArrayRankMismatch.h5MDShortArrayRankMismatchDetached.h5testAccessClosedReaderWriterdatasetsNonExtendable.h5accessClosedReaderWriter.h5testGetDataSetInformationFaileddsInfo.h5dsInfoFailed.h5testFixedLengthStringArraystringArray.h5fixedLengthStringArray.h5testWriteToEmptyFiletestStrangeDataSetName.h5writeToEmptyFile.h5testTimeDurationMDArraytimedurationarray.h5timedurationmdarray.h5testWriteByteArrayDataSetBlockWiseMismatchwriteByteArrayBlockWise.h5writeByteArrayBlockWiseMismatch.h5testWriteOpaqueByteArrayDataSetBlockWiseMismatchwriteOpaqueByteArrayBlockWise.h5writeOpaqueByteArrayBlockWiseMismatch.h5All 16 tests delete and recreate their file before using it, so none relied on another test's file. Every file name in the class is now used by exactly one test.
Verification
🤖 Generated with Claude Code