[master] 165921542 Revert vtest: Add "option timeout"

Nils Goroll nils.goroll at uplex.de
Tue May 28 09:13:04 UTC 2024


commit 16592154287145f5bebe77e29128dc3ec77d133a
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue May 28 11:10:54 2024 +0200

    Revert vtest: Add "option timeout"
    
    veto'ed by phk.
    
    It was my intention to make a helpful improvement along the way, but I have
    no capacity at the moment for a longer process.
    
    This reverts commit d6aef69a6b1da8fc8e392d2de159a0861418d7ce.
    This reverts commit 9b76b9a4baa4fedd2fb3a904b0dceafd263d0ddc.
    This reverts commit 8fc1b2c3af3eea0aa0a424fdc6bb76788a9f5661.

diff --git a/bin/varnishtest/cmds.h b/bin/varnishtest/cmds.h
index 257372b11..3b8a9e9fd 100644
--- a/bin/varnishtest/cmds.h
+++ b/bin/varnishtest/cmds.h
@@ -45,7 +45,6 @@ CMD_GLOBAL(include)
 #endif
 CMD_TOP(client)
 CMD_TOP(feature)
-CMD_TOP(option)
 CMD_TOP(filewrite)
 CMD_TOP(haproxy)
 #ifdef VTEST_WITH_VTC_LOGEXPECT
diff --git a/bin/varnishtest/tests/a00000.vtc b/bin/varnishtest/tests/a00000.vtc
index 423e8e23c..2d3604f24 100644
--- a/bin/varnishtest/tests/a00000.vtc
+++ b/bin/varnishtest/tests/a00000.vtc
@@ -1,8 +1,5 @@
 varnishtest "Test varnishtest itself"
 
-option timeout 60s
-option timeout x1.1
-
 shell -exit 1 -expect {varnishtest [options]} {varnishtest -h}
 
 shell -exit 1 -match {-D.*Define macro} {varnishtest -h}
diff --git a/bin/varnishtest/tests/v00051.vtc b/bin/varnishtest/tests/v00051.vtc
index 56069362d..dbdb26de2 100644
--- a/bin/varnishtest/tests/v00051.vtc
+++ b/bin/varnishtest/tests/v00051.vtc
@@ -1,7 +1,5 @@
 varnishtest "Test VCL failures"
 
-option timeout x2
-
 server s1 {
 	rxreq
 	expect req.url == /hit
diff --git a/bin/varnishtest/vtc_misc.c b/bin/varnishtest/vtc_misc.c
index 686fd191e..64d7b506d 100644
--- a/bin/varnishtest/vtc_misc.c
+++ b/bin/varnishtest/vtc_misc.c
@@ -660,48 +660,3 @@ cmd_feature(CMD_ARGS)
 		return;
 	}
 }
-
-static void
-set_timeout(struct vtclog *vl, const char *val)
-{
-	double num;
-	char *s = NULL;
-
-	if (val == NULL || *val == '\0')
-		vtc_fatal(vl, "FAIL test, missing \"option timeout\" value");
-	if (*val == 'x') {
-		num = strtod(val + 1, &s);
-		num *= vtc_maxdur;
-	} else
-		num = VNUM_duration(val);
-
-	if (isnan(num) || (s != NULL && *s != '\0'))
-		vtc_fatal(vl, "FAIL test, invalid \"option timeout\": %s", val);
-	vtc_maxdur = num;
-	vtc_log(vl, 4, "new timeout %.2f", vtc_maxdur);
-}
-
-/* SECTION: option <option> <value>
- *
- * Set varnishtest options
- *
- * timeout <duration>
- *         Override -t argument
- * timeout x<factor>
- *         Scale timeout by a <factor>
- */
-
-void v_matchproto_(cmd_f)
-cmd_option(CMD_ARGS)
-{
-
-	(void)priv;
-
-	if (av == NULL)
-		return;
-	av++;
-	if (!strcmp(av[0], "timeout"))
-		set_timeout(vl, av[1]);
-	else
-		vtc_fatal(vl, "FAIL test, unknown option: %s", av[0]);
-}


More information about the varnish-commit mailing list