Skip to content

Run the cookie_remap test origins on 127.0.0.1 - #13875

Merged
bryancall merged 1 commit into
apache:masterfrom
bryancall:fix-cookie-remap-flake
Oct 20, 2026
Merged

bryancall merged 1 commit into
apache:masterfrom
bryancall:fix-cookie-remap-flake

Conversation

@bryancall

Copy link
Copy Markdown
Contributor

The cookie_remap tests are the only microserver tests that bind their origins to 127.0.0.10 and 127.0.0.11. Python's HTTPServer calls socket.getfqdn() on the bind address while it starts, and those addresses are not in /etc/hosts, so every origin start sends a reverse DNS query. When the resolver drops that query, glibc retries after 5 seconds and gives up after 10, which is exactly AuTest's default startup timeout. AuTest then interrupts the origin before it is serving and the test fails on the origin's return code. 127.0.0.1 resolves from /etc/hosts without a query, which is why no other test hits this.

This binds the origins in all twelve tests to 127.0.0.1 and points their configs there. The two origins in each test already listen on different ports, and no gold file checks the address.

Testing, in the fedora:44 CI image under CPU load with a resolver that drops about 30% of queries: master failed 108 of 768 test runs, every one with the same "Checking that any test passes" failure CI has been reporting, and this change failed none of 768. With the resolver not answering at all, master failed 96 of 96 and this change none. With a healthy resolver, master passed all 1152 runs, so CPU load alone does not cause it. I can't see the resolver on the CI agents, so the dropped query there is inferred from the matching signature rather than observed.

The cookie_remap tests bound their microserver origins to 127.0.0.10
and 127.0.0.11. Python's HTTPServer calls socket.getfqdn() on the bind
address at startup, and those addresses are not in /etc/hosts, so every
origin start waited on a reverse DNS query. When the resolver drops the
query, glibc retries after 5 seconds and gives up after 10, the origin
misses AuTest's 10 second startup deadline, and AuTest interrupts it
before it is serving, so the test fails on the origin's return code.
Bind the origins to 127.0.0.1, which resolves from /etc/hosts; the two
origins in each test already listen on different ports.
Copilot AI balanced review requested due to automatic review settings October 20, 2026 05:16
@bryancall bryancall added this to the 11.0.0 milestone Oct 20, 2026
@bryancall bryancall self-assigned this Oct 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The test-only binding and destination changes are consistent, preserve port isolation, and have no identified blocking issues.

No open issues 🎉

What changed in this PR

This PR reduces DNS-related startup failures in ATS’s twelve cookie_remap tests by using 127.0.0.1 for their origins.

Changes:

  • Use the default loopback address when creating origins.
  • Update matching configuration destinations while preserving separate origin ports.
File Description
tests/​gold_tests/​pluginTest/​cookie_remap/​substitute.test.py Use default origin address.
tests/​gold_tests/​pluginTest/​cookie_remap/​subcookie.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​regexcookie.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​psubstitute.test.py Use default origin address.
tests/​gold_tests/​pluginTest/​cookie_remap/​pcollapseslashes.test.py Use default origin address.
tests/​gold_tests/​pluginTest/​cookie_remap/​notexistscookie.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​matchuri.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​matchcookie.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​existscookie.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​connector.test.py Use default origin addresses.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​substituteconfig.txt Point substitution destinations to loopback.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​subcookie.txt Update both routing destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​regexconfig.txt Update both regex destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​psubstituteconfig.txt Point substitution destinations to loopback.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​pcollapseconfig.txt Update slash-collapse destination.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​notexistsconfig.txt Update both cookie-check destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​matchuriconfig.txt Update both URI-match destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​matchconfig.txt Update both cookie-match destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​existsconfig.txt Update both cookie-check destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​connectorconfig.txt Update both connector destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​collapseconfig.txt Update slash-collapse destination.
tests/​gold_tests/​pluginTest/​cookie_remap/​configs/​bucketconfig.txt Update both bucket destinations.
tests/​gold_tests/​pluginTest/​cookie_remap/​collapseslashes.test.py Use default origin address.
tests/​gold_tests/​pluginTest/​cookie_remap/​bucketcookie.test.py Use default origin addresses.

Review effort: Balanced

@brbzull0 brbzull0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: no 127.0.0.10/.11 remains under cookie_remap and no other gold test binds a non-.1 loopback; HTTPServer.server_bind's getfqdn() on the bind address is the lookup in question; sendto/else origins stay distinguishable by port ($PORT/$ALTPORT from each server's own get_port) and path.

@bryancall
bryancall merged commit 7f49e4c into apache:master Oct 20, 2026
14 checks passed
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.

3 participants