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

Add group operation tests and object header continuation block tests to VFD SWMR #631

Merged
merged 13 commits into from
May 24, 2021

Conversation

kyang2014
Copy link
Collaborator

@kyang2014 kyang2014 commented May 6, 2021

The group operation tests are still in vfd_swmr_group_writer.c. Overall the subroutines are not that many and the testing frame work is easy to be adapted in this way. Test description is as follows:

  1. For both old-style and new-style group creation, the following tests are added:
    create_group, delete_group,move_group, insert_links, delete_links

  2. For new-styled group creation, the link storage transit from compact to dense and from dense to compact are tested.

  3. Also add object header continuation block tests for both old-style and new-style group creation. the tests are:
    add_ohr_block, del_ohr_block

kyang2014 and others added 7 commits April 28, 2021 14:45
The group operations include create/delete/move/add links/delete links/link storage.
…ature/vfd_swmr

group operation code should be updated at the vfd_swmr branch.
…ete_group,

move_group, insert_links, delete_links, link storage transition and old-styled group
creation.
@kyang2014 kyang2014 changed the title Add group operation tests to VFD SWMR Add group operation tests and object header continuation block tests to VFD SWMR May 19, 2021
/* Note: This is (mostly) because the verification failure message
* from the reader. So don't send the error message back to
* the reader. Just stop the test. */
goto error2;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand the "error2" and "error" situation.

Copy link
Collaborator Author

@kyang2014 kyang2014 May 21, 2021

Choose a reason for hiding this comment

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

For the test case that goes to the label "error", the error occurs on the writer side, so before it exits from the testing, the writer needs to send an error message to the reader, signal the reader that "the test on my side" is wrong, please stop your test. Otherwise, the reader may still wait for a message from the writer. The test on the reader side will hang.
For the test case that goes to the label "error2", the error actually occurs on the reader side, the writer receives an error message from the reader to let the test stop, so the writer doesn't need to send an error message to the reader again. It just exits out of the current test.


/* For group operation test, force the named pipe to communicate in every step. */
if (s.grp_op_test && s.use_named_pipes)
s.csteps = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think s.attr_test and s.grp_op_test cover all the test cases. When will s.csteps be not set to 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The default group test is the case when "s.attr_test and s.grp_op_test both false". For that test, s.csteps is not set to 1.

test/vfd_swmr_group_writer.c Outdated Show resolved Hide resolved
@@ -1676,6 +1870,16 @@ write_group(state_t *s, unsigned int which)
goto error;
}

/* We need to create a dummy dataset for the object header contiuation block test. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: spelling "contiuation"-->continuation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks done.

bool vg_ret = false;

if (!state_init(&s, argc, argv)) {
H5_FAILED();
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to replace all the occurrences of the following to "TEST_ERROR"
[ H5_FAILED(); AT(); goto error;]

TEST_ERROR is a macro defined in h5test.h and is generally used by the tests in the test directory. (See other tests in the test directory.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good, I will replace "[ H5_FAILED(); AT(); goto error;]" with TEST_ERROR. The " goto error2" has to stay the same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated the code.

Copy link
Contributor

@raylu-hdf raylu-hdf left a comment

Choose a reason for hiding this comment

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

I checked it twice. This PR looked fine to me.

@kyang2014 kyang2014 merged commit e226879 into HDFGroup:feature/vfd_swmr May 24, 2021
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.

3 participants