brbzull0 commented on code in PR #13862: URL: https://github.com/apache/trafficserver/pull/13862#discussion_r4326647585
########## include/tscore/ArgParser.h: ########## @@ -364,6 +394,14 @@ class ArgParser // Enable test mode - makes do_exit() throw instead of calling exit() for unit testing static void set_test_mode(bool test = true); + /** Clear the parser-wide state held at file scope in ArgParser.cc. + + Test-only. A program builds one parser and never reuses the state, but a unit test binary + runs many parsers in sequence, and set_default_command() or Command::set_default() would + otherwise leak default_command into every later test. + */ + static void reset_global_state(); Review Comment: No change, as in https://github.com/apache/trafficserver/pull/13862#discussion_r4314360496: `reset_global_state()` is declared under the `protected:` label of `ArgParser`, and `tscore` headers are not installed; tests reach it through a derived `Access` struct. ########## tests/gold_tests/autest-site/config_reload.test.ext: ########## @@ -140,7 +140,7 @@ def AddConfigReload( data=None, force=False, timeout="30s", - initial_wait=1.0, + initial_wait=None, Review Comment: No change: on master the helper passed `-w 1.0`, which the global `--watch` took and ignored, so every test already ran with traffic_ctl's own `--initial-wait` default; leaving the flag out keeps that timing, while passing `1.0` now would shorten every first poll for the first time. ########## tests/gold_tests/autest-site/config_reload.test.ext: ########## @@ -166,7 +166,7 @@ def AddConfigReload( force: If True, adds --force. timeout: Timeout duration string for --timeout (e.g. "30s", "1m"). Set to None to disable. - initial_wait: Seconds before first poll (--initial-wait). + initial_wait: Seconds before first poll (--initial-wait). None leaves traffic_ctl's own default. Review Comment: No change: on master the helper passed `-w 1.0`, which the global `--watch` took and ignored, so every test already ran with traffic_ctl's own `--initial-wait` default; leaving the flag out keeps that timing, while passing `1.0` now would shorten every first poll for the first time. ########## tests/gold_tests/autest-site/config_reload.test.ext: ########## @@ -199,7 +199,9 @@ def AddConfigReload( tr.StillRunningAfter = ts cmd = f"traffic_ctl config reload -m -t {_shell_quote(token)}" - cmd += f" -w {initial_wait} -r {refresh_int}" + cmd += f" -r {refresh_int}" + if initial_wait is not None: + cmd += f" --initial-wait {initial_wait}" Review Comment: No change: on master the helper passed `-w 1.0`, which the global `--watch` took and ignored, so every test already ran with traffic_ctl's own `--initial-wait` default; leaving the flag out keeps that timing, while passing `1.0` now would shorten every first poll for the first time. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
