try to address flakiness of lazy loading test

This commit is contained in:
David Lord 2021-10-05 08:03:30 -07:00
parent 6f7762538b
commit 6d65595a3c
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8

View file

@ -334,7 +334,9 @@ def test_lazy_load_error(monkeypatch):
lazy = DispatchingApp(bad_load, use_eager_loading=False)
with pytest.raises(BadExc):
lazy._flush_bg_loading_exception()
# reduce flakiness by waiting for the internal loading lock
with lazy._lock:
lazy._flush_bg_loading_exception()
def test_with_appcontext(runner):