Copilot commented on code in PR #13326:
URL: https://github.com/apache/trafficserver/pull/13326#discussion_r3470834376
##########
tests/gold_tests/pluginTest/stale_response/stale_response.test.py:
##########
@@ -33,7 +33,10 @@ class OptionType(Enum):
NONE = 0
DEFAULT_DIRECTIVES = 1
FORCE_SWR = 2
- FORCE_SIE = 2
+ FORCE_SIE = 3
+
+
+assert len({option.value for option in OptionType.__members__.values()}) ==
len(OptionType.__members__)
Review Comment:
The load-time guard uses a bare `assert`, which is skipped when Python is
run with optimizations (`python -O`). If the goal is to reliably fail fast on
duplicate `Enum` values, use an explicit runtime check that always runs (or
`enum.unique`).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]