dabla commented on code in PR #60152:
URL: https://github.com/apache/airflow/pull/60152#discussion_r2705901725
##########
airflow-core/tests/unit/jobs/test_triggerer_job.py:
##########
@@ -436,6 +436,23 @@ async def test_trigger_kwargs_serialization_cleanup(self,
session):
trigger_instance.cancel()
await runner.cleanup_finished_triggers()
+ @pytest.mark.asyncio
+ @patch("airflow.sdk.execution_time.task_runner.SUPERVISOR_COMMS",
create=True)
+ async def test_sync_state_to_supervisor(self, supervisor_builder):
+ trigger_runner = TriggerRunner()
+ trigger_runner.comms_decoder = AsyncMock(spec=TriggerCommsDecoder)
+ trigger_runner.comms_decoder.asend.side_effect = [
+ messages.TriggerStateSync(to_create=[], to_cancel=set()),
+ ]
+ trigger_runner.events.append((1, TriggerEvent(payload={"status":
"SUCCESS"})))
+ trigger_runner.events.append((2, TriggerEvent(payload={"status":
"FAILED"})))
+ trigger_runner.events.append((3, TriggerEvent(payload={"status":
"SUCCESS", "data": object()})))
+
+ await trigger_runner.sync_state_to_supervisor(finished_ids=[])
+
+ assert trigger_runner.comms_decoder.asend.call_count == 1
+ assert
len(trigger_runner.comms_decoder.asend.call_args_list[0].args[0].events) == 2
Review Comment:
This is fixed now in the unit test, now it will check 3 events first and
only 2 after sanitize function
--
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]