Skip to content

Commit

Permalink
Catch runtime error in iterator tests
Browse files Browse the repository at this point in the history
Summary: This is causing errors to be displayed in the test output.

Reviewed By: alexmalyshev

Differential Revision: D67205100

fbshipit-source-id: 2764562e16d0b124a826e2f80f5a2305e2434595
  • Loading branch information
Kevin Newton authored and facebook-github-bot committed Dec 13, 2024
1 parent f8a108b commit 954a585
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test_concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,13 @@ def test_iterator_failure(self):
iterator._dict = BreakingDict()

def worker():
iterator.insert(0, None)
try:
iterator.insert(0, None)
except RuntimeError:
# We want the insert to fail and set the internal flag to
# indicate that a failure occurred. We don't want the error to
# propagate further than this.
pass

t = threading.Thread(target=worker)
t.start()
Expand Down

0 comments on commit 954a585

Please sign in to comment.