Skip to content

Add Test.AddConfigReload() autest extension#13075

Open
brbzull0 wants to merge 1 commit intoapache:masterfrom
brbzull0:autest_reload_ext
Open

Add Test.AddConfigReload() autest extension#13075
brbzull0 wants to merge 1 commit intoapache:masterfrom
brbzull0:autest_reload_ext

Conversation

@brbzull0
Copy link
Copy Markdown
Contributor

@brbzull0 brbzull0 commented Apr 9, 2026

Replace the fragile pattern of fire-and-forget traffic_ctl config reload followed by sleep/log-grepping with a deterministic helper that uses monitor mode (-m) to block until completion and validates reload tasks via the get_reload_config_status JSONRPC endpoint.

The extension supports expected exit codes (success/fail/timeout/any), task presence and absence assertions, per-task status validation, custom tokens, and a delay_start parameter for filesystem timestamp sensitivity.

Migrate 21 existing tests to use the new helper, removing manual sleep synchronization and When.FileContains polling. Add an optional filename parameter to ConfigReloadTask so sub-tasks carry their associated config file for precise identification in test assertions.

Tiny change to the reload core:

Reload sub-tasks previously only carried a description (e.g."SNIConfig"), making it impossible to assert which config file triggereda task. The C++ change adds an optional filename parameter toConfigReloadTask::add_child() and ConfigContext::add_dependent_ctx()so the JSONRPC status endpoint returns the actual file path (e.g.sni.yaml, remap.yaml) for each sub-task. This allows tests to validate that the right config handlers ran -- or didn't run.

Includes RST documentation for the new extension API.

Fixes #12965

Replace the fragile pattern of fire-and-forget `traffic_ctl config
reload` followed by sleep/log-grepping with a deterministic helper
that uses monitor mode (`-m`) to block until completion and validates
reload tasks via the get_reload_config_status JSONRPC endpoint.

The extension supports expected exit codes (success/fail/timeout/any),
task presence and absence assertions, per-task status validation,
custom tokens, and a delay_start parameter for filesystem timestamp
sensitivity.

Migrate 21 existing tests to use the new helper, removing manual
sleep synchronization and When.FileContains polling. Add an optional
filename parameter to ConfigReloadTask so sub-tasks carry their
associated config file for precise identification in test assertions.

Includes RST documentation for the new extension API.
@brbzull0 brbzull0 added this to the 11.0.0 milestone Apr 9, 2026
@brbzull0 brbzull0 self-assigned this Apr 9, 2026
@brbzull0
Copy link
Copy Markdown
Contributor Author

brbzull0 commented Apr 9, 2026

[approve ci]

@brbzull0 brbzull0 marked this pull request as ready for review April 9, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ATS Reload migration task. Autest reload extension

1 participant