import asyncio
import pytest
from ezaudit import monitor


@monitor
async def quick_task(id, sleep_time):
    await asyncio.sleep(sleep_time)
    return id


@pytest.mark.asyncio
async def test_concurrent_execution():
    """Verify that multiple async tasks don't interfere with each other."""
    tasks = [
        quick_task(1, 0.1),
        quick_task(2, 0.05),
        quick_task(3, 0.15)
    ]
    results = await asyncio.gather(*tasks)

    assert results == [1, 2, 3]
    # Check your console: You should see 3 distinct log entries
    # appearing in the order they finished, not the order they started.
