)]}'
{"watcher/tests/unit/decision_engine/strategy/strategies/test_workload_preemption.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"a673a7b1d99149263a97286c20042dc6442c7735","unresolved":false,"context_lines":[{"line_number":842,"context_line":"        self.strategy.do_execute()"},{"line_number":843,"context_line":""},{"line_number":844,"context_line":"        # Only uuid-0002 should be preempted"},{"line_number":845,"context_line":"        if len(self.strategy.solution.actions) \u003e 0:"},{"line_number":846,"context_line":"            for action in self.strategy.solution.actions:"},{"line_number":847,"context_line":"                self.assertNotEqual("},{"line_number":848,"context_line":"                    \"uuid-0001-0000-0000-000000000001\","}],"source_content_type":"text/x-python","patch_set":1,"id":"1a3af978_1ad85c44","line":845,"updated":"2026-08-08 03:17:45.000000000","message":"The test guards its assertions with `if len(self.strategy.solution.actions) \u003e 0:` before iterating. If no actions are taken (e.g., due to a bug in filter_preemptable_candidates), the test body never executes and the test passes without verifying any behavior. The test should assert that exactly o...\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: A regression that prevents any preemption from occurring (e.g., filter_preemptable_candidates excluding all instances) would not be caught by this test. The test cannot distinguish between \u0027young instance correctly excluded\u0027 and \u0027no instances preempted at all.\u0027\n\n**Suggestion**:\nReplace the `if len \u003e 0` guard with `self.assertEqual(1, len(self.strategy.solution.actions))` and assert the action targets uuid-0002 (the old enough instance). This matches the pattern used in other tests in the same file.","commit_id":"ca7aaf96ba531eb6543d38ed30eb28c9505f6035"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"c04b8c19615c6ff6b3393a8b85c5e81b270f434c","unresolved":false,"context_lines":[{"line_number":868,"context_line":"        self.strategy.do_execute()"},{"line_number":869,"context_line":""},{"line_number":870,"context_line":"        # Only uuid-0002 should be preempted"},{"line_number":871,"context_line":"        if len(self.strategy.solution.actions) \u003e 0:"},{"line_number":872,"context_line":"            for action in self.strategy.solution.actions:"},{"line_number":873,"context_line":"                self.assertNotEqual("},{"line_number":874,"context_line":"                    \"uuid-0001-0000-0000-000000000001\","}],"source_content_type":"text/x-python","patch_set":2,"id":"9e278b27_b385de1f","line":871,"updated":"2026-08-13 17:25:02.000000000","message":"The test wraps its core assertion in an \u0027if len(actions) \u003e 0\u0027 guard, meaning the test passes even when zero preemption actions are produced. The test\u0027s stated purpose is to verify that young instances are protected while old ones are preempted, but the conditional guard means a no-op strategy wou...\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: A regression that causes the strategy to skip all instances (not just young ones) would not be caught by this test. The test should assert that exactly 1 action is produced and that it targets the correct (old enough) instance.\n\n**Suggestion**:\nReplace the conditional guard with an unconditional assertion: assertEqual(1, len(self.strategy.solution.actions)) followed by assertEqual on the action\u0027s resource_id to confirm it preempts uuid-0002 (the old-enough instance), and assertNotEqual or assert that uuid-0001 (the young instance) is never preempted.","commit_id":"4a1f1a6a839ebafd3e40db49309ec960aead5bf0"}]}
