async def mock_run_sync_activity(*args, **kwargs):
                """Simulate a long-running sync that will be cancelled."""
                nonlocal sync_activity_started
                sync_activity_started = True

                # Simulate work being done
                for i in range(100):  # Simulate 100 seconds of work
                    await asyncio.sleep(1)
                    # In real activity, this would be checking activity.is_cancelled()
                    # but in test environment we'll be cancelled via the workflow

                # Should not reach here due to cancellation
                pytest.fail("Activity should have been cancelled")
Simulate a long-running sync that will be cancelled.
backend/tests/integration/temporal/test_workflow_cancellation.py