Skip to content

Commit 5a1c5eb

Browse files
authored
Merge pull request pallets#4293 from pallets/flaky-lazy-test
try to address flakiness of lazy loading test
2 parents 6f77625 + 6d65595 commit 5a1c5eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ def bad_load():
334334
lazy = DispatchingApp(bad_load, use_eager_loading=False)
335335

336336
with pytest.raises(BadExc):
337-
lazy._flush_bg_loading_exception()
337+
# reduce flakiness by waiting for the internal loading lock
338+
with lazy._lock:
339+
lazy._flush_bg_loading_exception()
338340

339341

340342
def test_with_appcontext(runner):

0 commit comments

Comments
 (0)