diff options
author | Quincey Koziol <quincey@koziol.cc> | 2023-05-05 20:34:17 (GMT) |
---|---|---|
committer | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-05-05 22:24:11 (GMT) |
commit | e52122ecee89f0c02678fc0cc2516fc5b45b0bbe (patch) | |
tree | b3c57e7ad3080f34d475550c65c01caf2d382aec /test | |
parent | 5d7682c6b5150bc6918d2d22d77fde886b223d0d (diff) | |
download | hdf5-e52122ecee89f0c02678fc0cc2516fc5b45b0bbe.zip hdf5-e52122ecee89f0c02678fc0cc2516fc5b45b0bbe.tar.gz hdf5-e52122ecee89f0c02678fc0cc2516fc5b45b0bbe.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>
Diffstat (limited to 'test')
-rw-r--r-- | test/mirror_vfd.c | 19 |
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; |