Files
Brad Larsen 7f32919787 Fix nondeterminism in custom detectors (#4446)
Previously, a custom detector configured to use multiple patterns
would produce its results from a match in a nondeterministic order.
This behavior could be seen by running the custom detectors test in a
loop, e.g.,

    $ cd pkg/custom_detectors
    $ while true; do go test; done

This is likely to reveal sporadic test failures.

This nondeterminism was a result of producing results by iterating over
a map, which has unspecified order in Go.

The fix: sort the intermediate map data structure prior to producing
results.
2025-09-08 10:22:22 +05:00
..