summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <quincey@koziol.cc>2023-05-05 20:34:17 (GMT)
committerGitHub <noreply@github.com>2023-05-05 20:34:17 (GMT)
commitcc4d63b026dd0c392adc28e90a14eec47cb10bdd (patch)
tree27740be8851a387924e974745056ce4b193d795e
parent85077e83e0f93dde1e19faf1fdcdecf087af9278 (diff)
downloadhdf5-cc4d63b026dd0c392adc28e90a14eec47cb10bdd.zip
hdf5-cc4d63b026dd0c392adc28e90a14eec47cb10bdd.tar.gz
hdf5-cc4d63b026dd0c392adc28e90a14eec47cb10bdd.tar.bz2
Fix mirror VFD test timeouts (#2915)
* Close & re-open socket when looping for timeouts * Committing clang-format changes --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
-rw-r--r--test/mirror_vfd.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c
index b4f4c2c..489a9c0 100644
--- a/test/mirror_vfd.c
+++ b/test/mirror_vfd.c
@@ -1268,7 +1268,6 @@ create_mirroring_split_fapl(const char *basename, struct mirrortest_filenames *n
return ret_value;
error:
- HDfree(splitter_config);
H5E_BEGIN_TRY
{
H5Pclose(splitter_config->wo_fapl_id);
@@ -1276,6 +1275,7 @@ error:
H5Pclose(ret_value);
}
H5E_END_TRY;
+ HDfree(splitter_config);
return H5I_INVALID_HID;
} /* end create_mirroring_split_fapl() */
@@ -2328,7 +2328,7 @@ static int
confirm_server(struct mt_opts *opts)
{
char mybuf[16];
- int live_socket;
+ int live_socket = -1;
struct sockaddr_in target_addr;
unsigned attempt = 0;
@@ -2349,9 +2349,24 @@ confirm_server(struct mt_opts *opts)
HDprintf("ERROR connect() (%d)\n%s\n", errno, HDstrerror(errno));
return -1;
}
+
+ /* Close socket during sleep() */
+ if (HDclose(live_socket) < 0) {
+ HDprintf("ERROR close() can't close socket\n");
+ return -1;
+ }
+ live_socket = -1;
+
attempt++;
HDsleep(1);
HDprintf("attempt #%u: ERROR connect() (%d)\n%s\n", attempt, errno, HDstrerror(errno));
+
+ /* Re-open socket for retry */
+ live_socket = HDsocket(AF_INET, SOCK_STREAM, 0);
+ if (live_socket < 0) {
+ HDprintf("ERROR socket()\n");
+ return -1;
+ }
}
else
break;