From 6d65595a3c0a02d098c36f7d337e053e07975316 Mon Sep 17 00:00:00 2001 From: David Lord Date: Tue, 5 Oct 2021 08:03:30 -0700 Subject: [PATCH] try to address flakiness of lazy loading test --- tests/test_cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index e7462bde..9c51ffe9 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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):