Add Test.AddConfigReload() autest extension#13075
Open
brbzull0 wants to merge 1 commit intoapache:masterfrom
Open
Add Test.AddConfigReload() autest extension#13075brbzull0 wants to merge 1 commit intoapache:masterfrom
Test.AddConfigReload() autest extension#13075brbzull0 wants to merge 1 commit intoapache:masterfrom
Conversation
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.
Contributor
Author
|
[approve ci] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the fragile pattern of fire-and-forget
traffic_ctl config reloadfollowed 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
filenameparameter toConfigReloadTask::add_child()andConfigContext::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