summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_bigset_writer.c
diff options
context:
space:
mode:
authorvchoi <vchoi@jelly.ad.hdfgroup.org>2022-06-08 06:05:04 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2022-06-08 06:05:04 (GMT)
commitcf2b9d600a72cbe3caa87ee11ea2c828f48a561c (patch)
treef1870f6f97baae6bbec2593a986c2e9e699bfca3 /test/vfd_swmr_bigset_writer.c
parent7bbe45e71d74b342aadd086ac9174414542b2063 (diff)
downloadhdf5-cf2b9d600a72cbe3caa87ee11ea2c828f48a561c.zip
hdf5-cf2b9d600a72cbe3caa87ee11ea2c828f48a561c.tar.gz
hdf5-cf2b9d600a72cbe3caa87ee11ea2c828f48a561c.tar.bz2
(1) Modify test/vfd_swmr_bigset_writer.c to use h5_retry routines instead of "for loop for NUM_ATTEMPTS" times.
(2) Clean up test/vfd_swmr.c
Diffstat (limited to 'test/vfd_swmr_bigset_writer.c')
-rw-r--r--test/vfd_swmr_bigset_writer.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c
index 7d4c9d8..07eff66 100644
--- a/test/vfd_swmr_bigset_writer.c
+++ b/test/vfd_swmr_bigset_writer.c
@@ -81,6 +81,7 @@
#include "H5VLprivate.h"
#include "testhdf5.h"
+#include "H5retry_private.h"
#include "vfd_swmr_common.h"
#ifndef H5_HAVE_WIN32_API
@@ -2008,6 +2009,8 @@ verify_extensible_dset(state_t *s, unsigned int which, mat_t *mat, unsigned fini
base_t base, last;
unsigned int nchunks, step, ofs;
int i;
+ h5_retry_t retry;
+ hbool_t do_try; /* more tries remain */
if (which >= s->ndatasets) {
HDfprintf(stderr, "the dataset order is bigger than the number of datasets");
@@ -2016,9 +2019,11 @@ verify_extensible_dset(state_t *s, unsigned int which, mat_t *mat, unsigned fini
dset_id = s->dataset[which];
- /* Attempt to check the availability of the chunks for a number times
- * (NUM_ATTEMPTS) before reporting it as a failure */
- for (i = 0; i < NUM_ATTEMPTS; i++) {
+ /* Probably can do the same things in other parts that use NUM_ATTEMPTS */
+ for (do_try = H5_retry_init(&retry, NUM_ATTEMPTS, H5_RETRY_DEFAULT_MINIVAL,
+ H5_RETRY_DEFAULT_MAXIVAL);
+ do_try; do_try = H5_retry_next(&retry)) {
+
if (H5Drefresh(dset_id) < 0) {
HDfprintf(stderr, "H5Drefresh failed\n");
TEST_ERROR;
@@ -2057,11 +2062,8 @@ verify_extensible_dset(state_t *s, unsigned int which, mat_t *mat, unsigned fini
/* Make sure the chunks show up on the reader side. Otherwise sleep a while and try again */
if (nchunks >= last_step)
break;
- else
- decisleep(1);
}
-
- if (i == NUM_ATTEMPTS) {
+ if (!do_try) {
HDfprintf(stderr, "chunk verification reached the maximal number of attempts");
TEST_ERROR;
}