aglinxinyuan commented on code in PR #4488:
URL: https://github.com/apache/texera/pull/4488#discussion_r3165145924


##########
amber/src/main/python/core/runnables/test_main_loop.py:
##########
@@ -1139,6 +1139,63 @@ def send_resume(
             ),
         )
 
+    @pytest.mark.timeout(2)
+    def test_process_state_can_emit_multiple_states(
+        self,
+        main_loop,
+        output_queue,
+        mock_data_output_channel,
+        monkeypatch,
+    ):
+        class DummyExecutor:
+            @staticmethod
+            def process_state(state: State, port: int) -> State:
+                return {"value": state["value"] + 1, "port": port}
+
+        main_loop.context.executor_manager.executor = DummyExecutor()
+        monkeypatch.setattr(main_loop, "_check_and_process_control", lambda: 
None)
+        monkeypatch.setattr(
+            main_loop.context.output_manager,
+            "emit_state",
+            lambda state: [(mock_data_output_channel.to_worker_id, 
StateFrame(state))],
+        )
+
+        switch_count = {"value": 0}
+
+        def fake_switch_context():
+            switch_count["value"] += 1
+            # xinyuan-state-only still uses the original two-switch state 
handshake:

Review Comment:
   Removed. The comment now just describes the current two-switch handshake 
behavior without referring to the branch name.



-- 
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]

Reply via email to