1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00

tests: drop WinCNG retry workarounds

Should no longer be necessary after fixing the root cause.
(Though we do not run these tests in CI at the moment.)

Ref: #804
Follow-up to f216bbe3aa #2583
Follow-up to bc120a343b #1023

Closes #2603
This commit is contained in:
Viktor Szakats
2026-09-11 23:45:10 +02:00
parent 917f38bfe3
commit 5bfa574460
2 changed files with 14 additions and 51 deletions

View File

@@ -34,37 +34,16 @@
int main(void)
{
int exit_code;
int retries = 0, retry = 0;
#ifdef LIBSSH2_WINCNG
/* FIXME: Retry tests with WinCNG due to flakiness in hostkey
verification: https://github.com/libssh2/libssh2/issues/804 */
retries += 2;
#endif
do {
int skipped, rc;
LIBSSH2_SESSION *session = start_session_fixture(&skipped, &rc);
if(session)
exit_code = (test(session) == 0) ? 0 : 1;
else if(skipped) {
fprintf(stderr, "Test skipped.\n");
exit_code = 0;
}
else
exit_code = 1;
stop_session_fixture();
if(exit_code == 0 ||
#ifdef LIBSSH2_WINCNG
rc != LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE ||
#endif
++retry > retries) {
break;
}
fprintf(stderr, "Test failed (%d). Retrying... %d / %d\n",
rc, retry, retries);
} while(1);
int exit_code = 1;
int skipped, rc;
LIBSSH2_SESSION *session = start_session_fixture(&skipped, &rc);
if(session)
exit_code = (test(session) == 0) ? 0 : 1;
else if(skipped) {
fprintf(stderr, "Test skipped.\n");
exit_code = 0;
}
stop_session_fixture();
return exit_code;
}

View File

@@ -144,26 +144,10 @@ int main(int argc, char *argv[])
libssh2_session_set_blocking(session, 1);
{
int retries = 0, retry = 0;
#ifdef LIBSSH2_WINCNG
/* FIXME: Retry tests with WinCNG due to flakiness in hostkey
verification: https://github.com/libssh2/libssh2/issues/804 */
retries += 2;
#endif
do {
rc = libssh2_session_handshake(session, sock);
if(rc == 0)
break;
fprintf(stderr, "Failure establishing SSH session: %d\n", rc);
if(
#ifdef LIBSSH2_WINCNG
rc != LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE ||
#endif
++retry > retries)
break;
fprintf(stderr, "Retrying... %d / %d\n", retry, retries);
} while(1);
rc = libssh2_session_handshake(session, sock);
if(rc) {
fprintf(stderr, "Failure establishing SSH session: %d\n", rc);
goto shutdown;
}
rc = 1;