]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test574: add a timeout to the test
authorDan Fandrich <dan@coneharvesters.com>
Fri, 29 Sep 2023 19:28:57 +0000 (12:28 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 4 Oct 2023 19:15:57 +0000 (12:15 -0700)
This one hangs occasionally, so this will speed up a test run and allow
logs to be seen when it does.

Closes #12025

tests/libtest/lib574.c

index 8bb8704b93eef3bd1bb667c328691d7624df911d..79a9b167e76463b03f9408f049537066d9fe7d0a 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "memdebug.h"
 
+#define TEST_HANG_TIMEOUT (60 * 1000)
+
 static int new_fnmatch(void *ptr,
                        const char *pattern, const char *string)
 {
@@ -54,6 +56,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_URL, URL);
   test_setopt(curl, CURLOPT_WILDCARDMATCH, 1L);
   test_setopt(curl, CURLOPT_FNMATCH_FUNCTION, new_fnmatch);
+  test_setopt(curl, CURLOPT_TIMEOUT_MS, (long) TEST_HANG_TIMEOUT);
 
   res = curl_easy_perform(curl);
   if(res) {