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

chore: output unambiguous message #42

Closed
wants to merge 1 commit into from
Closed

Conversation

hyoklee
Copy link
Member

@hyoklee hyoklee commented Mar 30, 2023

@@ -152,7 +152,7 @@ test_open_file(void)
}
END_MULTIPART;

TESTING_2("test cleanup")
TESTING_2("test H5Pclose")
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't testing H5Pclose in particular. These messages refer to testing that resources can be cleaned up after a multi-part test so that the user knows whether testing failed during the test, or during cleanup of resources.

Copy link
Member Author

@hyoklee hyoklee Mar 30, 2023

Choose a reason for hiding this comment

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

What's your definition of cleanup? Who wrote this code?

/*                                                                                
 * Cleanup temporary test files                                                   
 */
static void
cleanup_files(void)
{
    hid_t fapl_id = H5I_INVALID_HID;

    if ((fapl_id = create_mpi_fapl(MPI_COMM_WORLD, MPI_INFO_NULL, TRUE)) < 0) {
        if (MAINPROCESS)
            HDprintf("    failed to create FAPL for deleting test files\n");
        return;
    }

    H5Fdelete(FILE_CREATE_TEST_FILENAME, fapl_id);


Copy link
Contributor

@jhendersonHDF jhendersonHDF Mar 30, 2023

Choose a reason for hiding this comment

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

I wrote that code and it's specifically for cleaning up files generated in the parallel file tests, which are separate from the vol_test_parallel.h5 file that contains all the other tests like the dataset ones. Cleanup of resources is cleanup.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think the meaning of "cleanup" here from 1998?


/*-------------------------------------------------------------------------
 * Function:  h5_cleanup
 *
 * Purpose:  Cleanup temporary test files.
 *    base_name contains the list of test file names.
 *    The file access property list is also closed.
 *
 * Return:  Non-zero if cleanup actions were performed; zero otherwise.
 *
 * Programmer:  Albert Cheng
 *              May 28, 1998
 *
 *-------------------------------------------------------------------------
 */
int
h5_cleanup(const char *base_name[], hid_t fapl)
{
    int retval = 0;

    if (GetTestCleanup()) {
        /* Clean up files in base_name, and the FAPL */
        h5_clean_files(base_name, fapl);

        retval = 1;
    } /* end if */

    /* Restore the original error reporting routine */
    h5_restore_err();

    return retval;
} /* end h5_cleanup() */

Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing in "cleanup" refers specifically to files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Then, why do you say clean up here?

On the other hand, the parallel test does seem to be missing a call to H5Fdelete to clean up after itself

Copy link
Contributor

Choose a reason for hiding this comment

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

Because in that particular instance I was referring specifically files.

@hyoklee hyoklee deleted the patch-2 branch March 31, 2023 14:14
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