Skip to content

Conversation

@alimirjamali
Copy link
Contributor

Python 3.14 (in Fedora 43) throws RunetimeError if event loop is not initialized before using it.

Resolves: QubesOS/qubes-issues#10188

@alimirjamali
Copy link
Contributor Author

PipelineRetryFailed

@alimirjamali alimirjamali force-pushed the issue-10188-asyncio branch 3 times, most recently from ce945b7 to 9eeaeb9 Compare August 28, 2025 10:24
@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.65%. Comparing base (5cb02f1) to head (2b8220c).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
qubesidle/idleness_monitor.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
- Coverage   90.20%   89.65%   -0.56%     
==========================================
  Files           3        3              
  Lines         143      145       +2     
==========================================
+ Hits          129      130       +1     
- Misses         14       15       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alimirjamali alimirjamali marked this pull request as ready for review August 28, 2025 11:02
@qubesos-bot
Copy link

qubesos-bot commented Aug 31, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025091702-4.3-fedora&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025081011-4.3&flavor=update

  • system_tests_splitgpg

    • system_tests: Fail (unknown)
      Tests qubes.tests.extra failed (exit code 1), details reported sepa...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_10_Thunderbird_fedora-43-xfce: test_000_send_receive_default (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

    • TC_10_Thunderbird_fedora-43-xfce: test_010_send_receive_inline_signed_only (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

    • TC_10_Thunderbird_fedora-43-xfce: test_020_send_receive_inline_with_attachment (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

  • system_tests_extra

  • system_tests_dispvm

    • TC_20_DispVM_fedora-43-xfce: test_100_open_in_dispvm (failure + cleanup)
      AssertionError: './open-file test.txt' failed with ./open-file test...
  • system_tests_audio

  • system_tests_qwt_win10@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-copy-notifi...
  • system_tests_qwt_win10_seamless@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Edge-address-...
  • system_tests_qwt_win11@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-menu-power' m...
  • system_tests_gpu_passthrough@hw13

    • gpu_passthrough: wait_serial (wait serial expected)
      # wait_serial expected: qr/jejxo-\d+-/...

    • gpu_passthrough: Failed (test died + timed out)
      # Test died: command 'qvm-template install debian-12-xfce' timed ou...

    • gpu_passthrough: wait_serial (wait serial expected)
      # wait_serial expected: qr/2JQKX-\d+-/...

  • system_tests_guivm_vnc_gui_interactive

    • gui_filecopy: unnamed test (unknown)
    • gui_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'disp-text-editor' mat...

Failed tests

27 failures
  • system_tests_splitgpg

    • system_tests: Fail (unknown)
      Tests qubes.tests.extra failed (exit code 1), details reported sepa...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_10_Thunderbird_fedora-43-xfce: test_000_send_receive_default (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

    • TC_10_Thunderbird_fedora-43-xfce: test_010_send_receive_inline_signed_only (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

    • TC_10_Thunderbird_fedora-43-xfce: test_020_send_receive_inline_with_attachment (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

  • system_tests_extra

    • system_tests: Fail (unknown)
      Tests qubes.tests.extra failed (exit code 1), details reported sepa...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_10_Thunderbird_fedora-43-xfce: test_000_send_receive_default (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

    • TC_10_Thunderbird_fedora-43-xfce: test_010_send_receive_inline_signed_only (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

    • TC_10_Thunderbird_fedora-43-xfce: test_020_send_receive_inline_with_attachment (failure + cleanup)
      ModuleNotFoundError: No module named 'pyatspi.image'

  • system_tests_dispvm

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.dispvm failed (exit code 1), details report...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_20_DispVM_fedora-43-xfce: test_100_open_in_dispvm (failure + cleanup)
      AssertionError: './open-file test.txt' failed with ./open-file test...

  • system_tests_audio

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.audio failed (exit code 1), details reporte...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_20_AudioVM_PipeWire_fedora-43-xfce: test_260_audio_mic_enabled_switch_audiovm (failure)
      AssertionError: 0 not greater than 0 : Failed to move-source-output

  • system_tests_qwt_win10@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-copy-notifi...
  • system_tests_qwt_win10_seamless@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Edge-address-...
  • system_tests_qwt_win11@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-menu-power' m...
  • system_tests_gpu_passthrough@hw13

    • gpu_passthrough: wait_serial (wait serial expected)
      # wait_serial expected: qr/jejxo-\d+-/...

    • gpu_passthrough: Failed (test died + timed out)
      # Test died: command 'qvm-template install debian-12-xfce' timed ou...

    • gpu_passthrough: wait_serial (wait serial expected)
      # wait_serial expected: qr/2JQKX-\d+-/...

  • system_tests_guivm_vnc_gui_interactive

    • gui_filecopy: unnamed test (unknown)
    • gui_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'disp-text-editor' mat...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/149225#dependencies

82 fixed
  • system_tests_extra

    • TC_00_QVCTest_whonix-workstation-17: test_010_screenshare (failure)
      AssertionError: 1 != 0 : Timeout waiting for /dev/video0 in test-in...
  • system_tests_dispvm

  • system_tests_audio

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_223_audio_play_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_224_audio_rec_muted_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_225_audio_rec_unmuted_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_252_audio_playback_audiovm_switch_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

  • system_tests_dispvm_perf@hw7

  • system_tests_guivm_gpu_gui_interactive@hw13

    • guivm_startup: wait_serial (wait serial expected)
      # wait_serial expected: qr/lEcbc-\d+-/...

    • guivm_startup: Failed (test died + timed out)
      # Test died: command '! qvm-check sys-whonix || time qvm-start sys-...

  • system_tests_basic_vm_qrexec_gui_ext4

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.vm_qrexec_gui failed (exit code 1), details...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_20_NonAudio_whonix-gateway-17-pool: test_012_qubes_desktop_run (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

  • system_tests_audio@hw1

    • system_tests: Fail (unknown)
      Tests qubes.tests.integ.audio failed (exit code 1), details reporte...

    • system_tests: Failed (test died)
      # Test died: Some tests failed at qubesos/tests/system_tests.pm lin...

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_223_audio_play_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 60 secon...

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_224_audio_rec_muted_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 60 secon...

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_252_audio_playback_audiovm_switch_hvm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 60 secon...

  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

Unstable tests

Performance Tests

Performance degradation:

4 performance degradations
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 206669.00 🔻 ( previous job: 265260.00, degradation: 77.91%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 55036.00 🔻 ( previous job: 431512.00, degradation: 12.75%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 105261.00 🔻 ( previous job: 196254.00, degradation: 53.64%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 6665.00 🔻 ( previous job: 7695.00, degradation: 86.61%)

Remaining performance tests:

78 tests
  • fedora-43-xfce_dispvm (mean:7.814): 93.77
  • fedora-43-xfce_dispvm-gui (mean:8.961): 107.54
  • fedora-43-xfce_dispvm-concurrent (mean:3.754): 45.05
  • fedora-43-xfce_dispvm-gui-concurrent (mean:4.407): 52.88
  • fedora-43-xfce_dispvm-dom0 (mean:8.288): 99.46
  • fedora-43-xfce_dispvm-dom0-gui (mean:9.584): 115.00
  • fedora-43-xfce_dispvm-dom0-concurrent (mean:3.863): 46.35
  • fedora-43-xfce_dispvm-dom0-gui-concurrent (mean:4.625): 55.49
  • fedora-43-xfce_dispvm-preload (mean:4.269): 51.23
  • fedora-43-xfce_dispvm-preload-gui (mean:4.879): 58.55
  • fedora-43-xfce_dispvm-preload-concurrent (mean:3.113): 37.35
  • fedora-43-xfce_dispvm-preload-gui-concurrent (mean:3.716): 44.59
  • fedora-43-xfce_dispvm-preload-dom0 (mean:4.463): 53.55
  • fedora-43-xfce_dispvm-preload-dom0-gui (mean:5.484): 65.81
  • fedora-43-xfce_dispvm-preload-dom0-concurrent (mean:3.662): 43.94
  • fedora-43-xfce_dispvm-preload-dom0-gui-concurrent (mean:4.295): 51.54
  • fedora-43-xfce_dispvm-api (mean:8.369): 100.43
  • fedora-43-xfce_dispvm-gui-api (mean:9.713): 116.55
  • fedora-43-xfce_dispvm-concurrent-api (mean:3.961): 47.54
  • fedora-43-xfce_dispvm-gui-concurrent-api (mean:4.611): 55.33
  • fedora-43-xfce_dispvm-preload-api (mean:4.537): 54.44
  • fedora-43-xfce_dispvm-preload-less-api (mean:7.721): 92.65
  • fedora-43-xfce_dispvm-preload-more-api (mean:4.14): 49.68
  • fedora-43-xfce_dispvm-preload-gui-api (mean:5.483): 65.79
  • fedora-43-xfce_dispvm-preload-concurrent-api (mean:3.69): 44.28
  • fedora-43-xfce_dispvm-preload-gui-concurrent-api (mean:4.37): 52.44
  • fedora-43-xfce_vm (mean:0.027): 0.32
  • fedora-43-xfce_vm-gui (mean:0.034): 0.41
  • fedora-43-xfce_vm-concurrent (mean:0.02): 0.24
  • fedora-43-xfce_vm-gui-concurrent (mean:0.019): 0.23
  • fedora-43-xfce_vm-api (mean:0.038): 0.46
  • fedora-43-xfce_vm-gui-api (mean:0.042): 0.50
  • fedora-43-xfce_vm-concurrent-api (mean:0.027): 0.32
  • fedora-43-xfce_vm-gui-concurrent-api (mean:0.03): 0.36
  • fedora-43-xfce_exec: 9.20
  • fedora-43-xfce_exec-root: 68.14
  • fedora-43-xfce_socket: 8.38
  • fedora-43-xfce_socket-root: 8.60
  • fedora-43-xfce_exec-data-simplex: 73.71
  • fedora-43-xfce_exec-data-duplex: 70.85
  • fedora-43-xfce_exec-data-duplex-root: 104.75
  • fedora-43-xfce_socket-data-duplex: 136.61
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 460305.00 🔻 ( previous job: 497426.00, degradation: 92.54%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 23928.00 🔻 ( previous job: 23940.00, degradation: 99.95%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 3619.00 🟢 ( previous job: 2446.00, improvement: 147.96%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 10829.00 🟢 ( previous job: 5874.00, improvement: 184.35%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 4540.00 🟢 ( previous job: 29.00, improvement: 15655.17%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 504851.00 🟢 ( previous job: 292489.00, improvement: 172.61%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 227161.00 🟢 ( previous job: 110817.00, improvement: 204.99%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 438001.00 🟢 ( previous job: 137802.00, improvement: 317.85%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 188523.00 🟢 ( previous job: 121719.00, improvement: 154.88%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 107693.00 🟢 ( previous job: 103932.00, improvement: 103.62%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 8406.00 🟢 ( previous job: 6356.00, improvement: 132.25%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 4744.00 🟢 ( previous job: 3925.00, improvement: 120.87%)
  • fedora-43-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 389805.00
  • fedora-43-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 154440.00
  • fedora-43-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 316407.00
  • fedora-43-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 48034.00
  • fedora-43-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 89265.00
  • fedora-43-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 3502.00
  • fedora-43-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8816.00
  • fedora-43-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 602.00
  • fedora-43-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 350811.00
  • fedora-43-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 214652.00
  • fedora-43-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 269764.00
  • fedora-43-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 82896.00
  • fedora-43-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 41074.00
  • fedora-43-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 3460.00
  • fedora-43-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 6787.00
  • fedora-43-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 1261.00
  • fedora-43-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 258524.00
  • fedora-43-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 193899.00
  • fedora-43-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 320567.00
  • fedora-43-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 17583.00
  • fedora-43-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 40466.00
  • fedora-43-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 1982.00
  • fedora-43-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 8282.00
  • fedora-43-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 1439.00

@marmarek
Copy link
Member

This doesn't work:

Traceback (most recent call last):
  File "/usr/bin/qubes-idle-watcher", line 33, in <module>
    sys.exit(load_entry_point('qubesidle==1.0.11', 'console_scripts', 'qubes-idle-watcher')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/qubesidle/idleness_monitor.py", line 114, in main
    monitor.load_watchers()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/qubesidle/idleness_monitor.py", line 42, in load_watchers
    self.add_watcher(entry_point.load()())
                     ~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/qubesidle/idle_watcher_window.py", line 59, in __init__
    loop = asyncio.get_event_loop()
  File "/usr/lib64/python3.14/asyncio/events.py", line 715, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
                       % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.

@alimirjamali
Copy link
Contributor Author

This doesn't work:

Fix applied

Copy link
Member

@marmarek marmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also, split CI update into separate commit please

self.wait_future = None

file_descriptor = self.conn.get_file_descriptor()
asyncio.set_event_loop(asyncio.new_event_loop())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creating new loop from within a plugin is a bad idea, better to do that before in main before loading them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also done. Two places. In main function and in unittest setup

Drop r4.1, add r4.3
Update codecov
Add `run-tests`
Python 3.14 (in Fedora 43) throws RunetimeError if event loop is not
initialized before using it.

Resolves: QubesOS/qubes-issues#10188
@alimirjamali
Copy link
Contributor Author

and also, split CI update into separate commit please

This is done

@marmarek marmarek merged commit 2b8220c into QubesOS:main Sep 17, 2025
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncio.get_event_loop() throws RuntimeError on Fedora 43 / Python 3.14 if event loop is not initialized

4 participants