async def test_workflow_success_no_status_update(self, mock_dicts):
        """Test that workflow doesn't update status on successful completion."""
        async with WorkflowEnvironment() as env:
            # Mock the activities
            async def mock_run_sync_activity_success(*args, **kwargs):
                # Successful completion
                return None

            status_updated = False

            async def mock_update_status_activity(*args, **kwargs):
                nonlocal status_updated
                status_updated = True
                # This should not be called on success
                pytest.fail("Status update should not be called on success")

            # Register mocked activities
            env.set_activity_implementation(run_sync_activity, mock_run_sync_activity_success)
            env.set_activity_implementation(
                update_sync_job_status_activity, mock_update_status_activity
            )

            # Run the workflow - should complete successfully
            await env.client.execute_workflow(
                RunSourceConnectionWorkflow.run,
                args=[
                    mock_dicts["sync_dict"],
                    mock_dicts["sync_job_dict"],
                    mock_dicts["sync_dag_dict"],
                    mock_dicts["collection_dict"],
                    mock_dicts["source_connection_dict"],
                    mock_dicts["user_dict"],
                    None,
                ],
                id=f"test-workflow-{uuid4()}",
                task_queue="test-queue",
            )

            # Verify that the status update activity was NOT called
            assert not status_updated, "Status update activity should not be called on success"
Test that workflow doesn't update status on successful completion.
backend/tests/unit/platform/temporal/test_error_handling.py