def METHOD_NAME(test_microvm_with_api):
    """
    Test that writing to stdout never blocks the vCPU thread.
    """
    test_microvm = test_microvm_with_api
    test_microvm.jailer.daemonize = False
    test_microvm.spawn()
    # Set up the microVM with 1 vCPU so we make sure the vCPU thread
    # responsible for the SSH connection will also run the serial.
    test_microvm.basic_config(
        vcpu_count=1,
        mem_size_mib=512,
        boot_args="console=ttyS0 reboot=k panic=1 pci=off",
    )
    test_microvm.add_net_iface()
    test_microvm.start()
    # Get an initial reading of missed writes to the serial.
    fc_metrics = test_microvm.flush_metrics()
    init_count = fc_metrics["uart"]["missed_write_count"]
    screen_pid = test_microvm.screen_pid
    # Stop `screen` process which captures stdout so we stop consuming stdout.
    subprocess.check_call("kill -s STOP {}".format(screen_pid), shell=True)
    # Generate a random text file.
    exit_code, _, _ = test_microvm.ssh.run(
        "base64 /dev/urandom | head -c 100000 > /tmp/file.txt"
    )
    # Dump output to terminal
    exit_code, _, _ = test_microvm.ssh.run("cat /tmp/file.txt > /dev/ttyS0")
    assert exit_code == 0
    # Check that the vCPU isn't blocked.
    exit_code, _, _ = test_microvm.ssh.run("cd /")
    assert exit_code == 0
    # Check the metrics to see if the serial missed bytes.
    fc_metrics = test_microvm.flush_metrics()
    last_count = fc_metrics["uart"]["missed_write_count"]
    # Should be significantly more than before the `cat` command.
    assert last_count - init_count > 10000