Running with debug mode enabled turns several silent problems into log output. Callbacks and tasks that take longer than 100 milliseconds are logged as slow, with the coroutine and its source location, which is the fastest way to find the blocking call that is stalling an event loop.
Debug mode also logs coroutines that were never awaited, reports tasks destroyed while still pending, and enables extra checks that non-threadsafe calls are made from the correct thread. Exception tracebacks include the coroutine's creation site, not just where it failed.
Enable it with asyncio.run(main(), debug=True), the PYTHONASYNCIODEBUG=1 environment variable, or python -X dev, which turns on the development mode that includes it. The slow-callback threshold is tunable with loop.slow_callback_duration. Debug mode is meaningfully slower, so it belongs in development and in a dedicated CI job rather than in production. Pair it with -W error::RuntimeWarning so a never-awaited coroutine fails the test rather than printing a warning nobody reads.