Skip to content

Conversation

@evvaaaa
Copy link
Contributor

@evvaaaa evvaaaa commented Nov 25, 2024

We'd get the following failure around 50% of test runs -

FAILED tests/backends/tango/test_dsr.py::TestTangoDevice::test_big_enum - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <socket.socket fd=-1, family=1, type=1, proto=0>

Traceback (most recent call last):
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/unittest/mock.py", line 2124, in _mock_set_magics
    setattr(_type, entry, MagicProxy(entry, self))
                          ^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed <socket.socket fd=28, family=1, type=1, proto=0>

This wasn't a problem in the big enum itself, commenting out test_big_enum will simply move the failure to the next test.

Explicitly closing the test client seems to do the trick.

@evvaaaa evvaaaa requested a review from marcelldls November 25, 2024 14:33
@codecov
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.74%. Comparing base (9d3d9bf) to head (18e9909).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #92   +/-   ##
=======================================
  Coverage   86.74%   86.74%           
=======================================
  Files          25       25           
  Lines        1056     1056           
=======================================
  Hits          916      916           
  Misses        140      140           

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


🚨 Try these New Features:

@evvaaaa evvaaaa requested a review from GDYendell November 25, 2024 15:56
Copy link
Contributor

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

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

Looks good, assuming TestClient does the right thing.

@evvaaaa evvaaaa merged commit cec9fda into main Nov 25, 2024
18 checks passed
@evvaaaa evvaaaa deleted the fixed-flakey-test branch November 25, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants