question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_mainwindow.py opens too many file descriptors and sockets

See original GitHub issue

Hi,

First, I want to clarify that I am fully aware of the fact, that you do not support running unit tests outside of your own development environments and CIs. However, because I think this might be related to what happens in #12247, I am reporting anyway. Please, don’t feel obliged to dig too much into it if you feel this does not apply to the scenarios you are officially supporting.

In my endeavor to stabilize Spyder for the OpenSUSE Linux distro package which I am maintaining, I try to run as many unit tests as possible in order to detect possible package incompatibilites.

Fact is, the execution of python3 runtests.py --run-slow always fails with a segfault or breakpoint trap. This happens not always at the same test but consistently a few dozen tests into the test_mainwindow.py suite. Sometimes there is a Too many open files error message associated with it.

I added a few debug statements to the main_window fixture and found out that for each test, the number of open files and sockets increases. Specifically the pdb_history.sqlite file is opened many times but not closed at teardown of the test. I suspect this is because of the reuse of the window as introduced in #10444. This could also be the reason why #12247 cannot open any new connections.

I will dig more into this, but any hints would be appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
impact27commented, Apr 15, 2020

Done in #12340

0reactions
ccordoba12commented, Apr 15, 2020

If you need to fix that now:

@impact27, I think this is important enough to have it in 4.1.3 (our next release). Could you make a PR for that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing the “Too many open files” Error in Linux - Baeldung
Learn about the Linux system limits placed on file descriptors in the context of understanding and resolving the "Too many open files" error....
Read more >
How to Fix the 'Too Many Open Files' Error in Linux?
It means that a process has opened too many files (file descriptors) and cannot open new ones. On Linux, the “max open file...
Read more >
ValueError: too many file descriptors in select() on Windows
By default Windows can use only 64 sockets in asyncio loop. This is a limitation of underlying select() API call.
Read more >
How to diagnose 'TOO MANY OPEN FILES' issues? - IBM
Answer. Applications or servers can sometimes fail with an error indicating that there are too many open files for the current process.
Read more >
unix sockets consumes too many file descriptors #252 - GitHub
Running puppetmaster with puma, it quickly run out of files descriptors when binding unix socket. strace output sample : [.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found