Add test for TSHttpTxnServerAddrSet retry behavior (issue #12611)#12727
Add test for TSHttpTxnServerAddrSet retry behavior (issue #12611)#12727bryancall wants to merge 3 commits intoapache:masterfrom
Conversation
|
[approve ci debian fedora rocky ubuntu] |
There was a problem hiding this comment.
Pull request overview
This PR adds a test case to demonstrate issue #12611, where the TS_HTTP_OS_DNS_HOOK is not invoked again when a connection retry occurs after using TSHttpTxnServerAddrSet(). The test includes a C++ plugin that sets different addresses on sequential OS_DNS hook calls and a Python test script that verifies the bug's existence by checking that the hook is only called once.
Key changes:
- New C++ test plugin that tracks OS_DNS hook invocations and sets non-routable vs. routable addresses
- Python test script that configures ATS with connection retry settings and validates log output
- Build system update to compile the new test plugin
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test_TSHttpTxnServerAddrSet_retry.test.py | Python test framework that configures ATS with retry settings and validates that OS_DNS hook is only called once, confirming the bug |
| test_TSHttpTxnServerAddrSet_retry.cc | C++ plugin that attempts to set different addresses on OS_DNS hook calls and reports how many times the hook was invoked |
| CMakeLists.txt | Adds the new test plugin to the build system |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This test demonstrates that TSHttpTxnServerAddrSet() retry fails because the OS_DNS hook is not called again when connection fails. The test plugin: - Sets a bad address (192.0.2.1) on first OS_DNS call - will fail to connect - Should set a good address (127.0.0.1) on retry if OS_DNS is called again - Uses per-transaction storage (TSUserArg) to track call count correctly - Logs whether OS_DNS was called once (bug) or multiple times (correct) Expected result on master (bug exists): - OS_DNS hook called only ONCE - Connection fails with bad address - Plugin never gets chance to provide alternative address - Test detects and reports: BUG CONFIRMED This test should FAIL/detect bug on master branch. Once the fix is applied, the test should PASS (OS_DNS called multiple times).
1f86ec7 to
b593d32
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The test should: - FAIL on master (bug exists, 'SUCCESS' message not present) - PASS after fix is applied (OS_DNS called multiple times, 'SUCCESS' logged) This makes it a proper regression test that will catch if the bug is reintroduced.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
[approve ci] |
Use '=' instead of '+=' for the first diags.log check to override the default 'should not contain errors' check. This allows the test plugin to use TSError() for diagnostic output that we verify.
b918a13 to
85584d2
Compare
|
[approve ci] |
|
This PR was just for testing and seeing if the autest would fail correctly in CI. It was helpful in finding an issue with CI and not correctly failing. The new PR that includes the fix and this test is: #12733 |
This PR adds a test that demonstrates issue #12611: TSHttpTxnServerAddrSet() retry fails because the OS_DNS hook is not called again when connection fails.
Test Description
The test plugin (
test_TSHttpTxnServerAddrSet_retry):TS_HTTP_OS_DNS_HOOKExpected Results
On master (bug exists):
BUG CONFIRMED: OS_DNS hook was only called ONCEAfter fix is applied:
SUCCESS: OS_DNS hook was called X timesTest Output on Master (Confirms Bug)
This test is a precursor to the fix PR for #12611.