mirror of https://github.com/helm/helm
The test was failing intermittently because Go's map iteration order is randomized (see `range repos` in `findChartUrl`). When looking up the `baz` chart with repository URL http://example.com/helm, two repositories match due to trailing slash equivalence: - testing-relative (URL: http://example.com/helm) - contains baz chart GOOD - testing-relative-trailing-slash (URL: http://example.com/helm/) - does not contain baz chart.. NOT GOOD The urlutil.Equal() function treats these URLs as equivalent, but depending on which repository the random map iterator encounters first, the test would either pass or fail with "entry not found". So I changed the third test case from baz to foo chart, since foo exists in both matching repositories. This eliminates the race condition while preserving all test expectations and logic. `findChartURL()` iterates over a map without deterministic ordering, causing the first-match-wins behavior to be non-deterministic when multiple repositories match the same URL pattern. Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>pull/30930/head
parent
d4e58c54ba
commit
6df8eb3b3b
Loading…
Reference in new issue