Skip to content

test(dynamicpathdetector): isolate analyzer per subtest in TestAnalyz…#22

Merged
entlein merged 1 commit into
mainfrom
fix/endpoint-test-analyzer-isolation
Apr 29, 2026
Merged

test(dynamicpathdetector): isolate analyzer per subtest in TestAnalyz…#22
entlein merged 1 commit into
mainfrom
fix/endpoint-test-analyzer-isolation

Conversation

@entlein
Copy link
Copy Markdown

@entlein entlein commented Apr 29, 2026

…eEndpoints

The table-driven TestAnalyzeEndpoints shared one PathAnalyzer across all subtests. Because AnalyzeEndpoints mutates the analyzer trie, expected outputs of later subtests were silently coupled to the trie state left by earlier ones — running any case in isolation would have exercised a different state and could mask regressions.

Move the analyzer construction inside the t.Run loop so each subtest starts from a fresh trie. Restore the 'Test with 0 port' expected output to its order-independent shape (the :80 entry stays as :80/users/⋯/posts/101 because no other input reaches the trie's dynamic-collapse threshold within that case).

Addresses CodeRabbit review on #21.

Sorry, we do not accept changes directly against this repository. Please see
CONTRIBUTING.md for information on where and how to contribute instead.

…eEndpoints

The table-driven TestAnalyzeEndpoints shared one PathAnalyzer across
all subtests. Because AnalyzeEndpoints mutates the analyzer trie,
expected outputs of later subtests were silently coupled to the trie
state left by earlier ones — running any case in isolation would have
exercised a different state and could mask regressions.

Move the analyzer construction inside the t.Run loop so each subtest
starts from a fresh trie. Restore the 'Test with 0 port' expected
output to its order-independent shape (the :80 entry stays as
:80/users/⋯/posts/101 because no other input reaches the trie's
dynamic-collapse threshold within that case).

Addresses CodeRabbit review on #21.
@entlein
Copy link
Copy Markdown
Author

entlein commented Apr 29, 2026

ok, lets retest

@entlein entlein merged commit a956d2d into main Apr 29, 2026
2 checks passed
@entlein entlein deleted the fix/endpoint-test-analyzer-isolation branch April 29, 2026 08:32
@github-actions
Copy link
Copy Markdown

Summary:

  • License scan: failure
  • Credentials scan: skipped
  • Vulnerabilities scan: skipped
  • Unit test: success
  • Go linting: failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant