-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Add group operation tests and object header continuation block tests to VFD SWMR #631
Conversation
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.
/* 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@@ -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. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: spelling "contiuation"-->continuation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks done.
test/vfd_swmr_group_writer.c
Outdated
bool vg_ret = false; | ||
|
||
if (!state_init(&s, argc, argv)) { | ||
H5_FAILED(); |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code.
There was a problem hiding this 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.
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:
For both old-style and new-style group creation, the following tests are added:
create_group, delete_group,move_group, insert_links, delete_links
For new-styled group creation, the link storage transit from compact to dense and from dense to compact are tested.
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