You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/04/12 13:58:32 UTC
[PR] fix: enforce distinct matching in contains and add containsOnce with backtracking [skywalking-infra-e2e]
wu-sheng opened a new pull request, #143:
URL: https://github.com/apache/skywalking-infra-e2e/pull/143
## Summary
- Fix a bug in `contains` where one actual item could satisfy multiple expected entries, causing false-positive test results (resolves apache/skywalking#8752). Now each actual item can only be claimed by one expected entry (greedy distinct matching).
- Add new `containsOnce` keyword that uses backtracking to find an optimal assignment between expected entries and actual items, solving cases where greedy ordering fails.
- Add 9 new test cases covering both the bug fix and `containsOnce` behavior.
## Changes
| File | Change |
|------|--------|
| `third-party/go/template/exec.go` | Fix `walkContains` distinct matching; add `walkContainsOnce` with backtracking |
| `third-party/go/template/parse/lex.go` | Add `containsOnce` token |
| `third-party/go/template/parse/node.go` | Add `ContainsOnceNode` type |
| `third-party/go/template/parse/parse.go` | Add `containsOnceControl` parser |
| `internal/components/verifier/verifier_test.go` | 9 new test cases |
| `docs/en/setup/Configuration-File.md` | Document `contains` and `containsOnce` |
| `CLAUDE.md` | Add GitHub Actions allow list info |
## Test plan
- [x] All existing tests pass (no regression)
- [x] `contains` now fails when 1 actual item tries to satisfy 2+ expected entries
- [x] `contains` now fails when expected entries exceed actual item count
- [x] `containsOnce` finds valid assignment via backtracking when greedy fails
- [x] `containsOnce` fails when not enough distinct actual items
- [x] `containsOnce` fails when specific expected value is missing
- [ ] Verify in downstream SkyWalking e2e tests that existing `contains` usage is unaffected
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: enforce distinct matching in contains and add containsOnce with backtracking [skywalking-infra-e2e]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #143:
URL: https://github.com/apache/skywalking-infra-e2e/pull/143
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org