async def test_successful_workflow_no_status_update(self, mock_dicts, mock_sync_job_id):
        """Test that successful workflow completion doesn't call the error status update."""

        async with WorkflowEnvironment() as env:
            # Track what happened
            sync_completed = False
            error_status_update_called = False

            async def mock_run_sync_activity_success(*args, **kwargs):
                """Simulate a successful sync."""
                nonlocal sync_completed
                sync_completed = True
                # Quick completion
                await asyncio.sleep(0.1)
                return None

            async def mock_update_status_activity(*args, **kwargs):
                """This should NOT be called for successful completion."""
                nonlocal error_status_update_called
                error_status_update_called = True
                pytest.fail("Error status update should not be called for successful workflow")

            # 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)

            # Start and run the workflow
            result = 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-success-{mock_sync_job_id}",
                task_queue="test-queue",
            )

            # Verify the sync completed successfully
            assert sync_completed, "Sync activity should have completed"
            assert not error_status_update_called, "Error status update should not have been called"
Test that successful workflow completion doesn't call the error status update.
backend/tests/integration/temporal/test_workflow_cancellation.py