• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elParaguayo / qtile / 12036727602 / 3
83%
master: 83%

Build:
DEFAULT BRANCH: master
Ran 26 Nov 2024 06:45PM UTC
Files 151
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Nov 2024 03:01PM UTC coverage: 66.945% (-0.006%) from 66.951%
12036727602.3

push

github

tych0
tests: don't use multiprocessing.Queue

we are getting some warnings in pythons >= 3.12 of the following form:

      /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/multiprocessing/popen_fork.py:66: Deprecat
        self.pid = os.fork()

    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
    ==== 1277 passed, 25 skipped, 2 xpassed, 299 warnings in 1252.65s (0:20:52) ====

it turns out that some of these are from Qtile proper that I have fixed,
but the test suite itself spawns threads, which causes these again when we
e.g. use multiprocessing.Process() to create a process (the subprocess
module uses vfork() under the hood, so it is not subject to these same
problems or DeprecationWarnings).

pytest's docs [1] explicitly mention that it is single threaded:

    pytest is single-threaded, executing its tests always in the same
    thread, sequentially, never spawning any threads itself.

so it's not pytest. So who is spawning the threads? Almost as an
afterthought of an implementation detail, it seems to be
multiprocessing.Queue [2]:

    When a process first puts an item on the queue a feeder thread is
    started which transfers objects from a buffer into the pipe.

Since we use multiprocessing.Queue in the `logger` fixture, the fixture is
run, the Queue thread is started, etc. all before we spawn the qtile
process, and we get this warning.

Luckily, we can implement this same functionality directly via os.pipe()
and os.fork() in less code than the fixture setup with one insight: we
don't need constant message passing, because we're not worried about the
kernel's pipe buffer filling up. This is only for test cases, who only ever
write a small amount of logs, so "64k should be enough for anybody".

Unfortunately, this only gets us a few warnings reduced: the ones from
test_manager, and a few from test_base and test_tasklist. But, it's a
start...

[1]: https://docs.pytest.org/en/stable/explanation/flaky.html#thread-safety
... (continued)

14450 of 21585 relevant lines covered (66.94%)

0.67 hits per line

Source Files on job 3.13-wayland - 12036727602.3
  • Tree
  • List 0
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 12036727602
  • 1dacffb8 on github
  • Prev Job for on master (#11947753244.6)
  • Next Job for on master (#12104612737.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc