Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NetBSD] Process threads() and num_threads() keep listing dead threads #2236

Closed
giampaolo opened this issue Apr 15, 2023 · 0 comments
Closed

Comments

@giampaolo
Copy link
Owner

Summary

  • OS: NetBSD
  • Type: core

Description

======================================================================
FAIL: psutil.tests.test_process.TestProcess.test_threads
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/psutil/psutil/tests/test_process.py", line 538, in test_threads
    self.assertEqual(len(step2), len(step1) + 1)
AssertionError: 2 != 3

The test failure above indicates that after a thread is terminated Process.threads() keeps listing it as if it was alive. It took me a while to understand why that is. It turns out that some threads stick around even after terminated, and their status is either zombie or idle (LSZOMB, LSIDL). As such psutil should skip/ignore these threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant