diff --git a/requirements.txt b/requirements.txt index aefa233f..597e5178 100644 --- a/requirements.txt +++ b/requirements.txt @@ -84,4 +84,3 @@ werkzeug==3.1.8 # flask # flask-cors -opengeodeweb-microservice==1.*,>=1.5.0rc1 diff --git a/tests/test_background_native_save.py b/tests/test_background_native_save.py index d50b9159..7381feb6 100644 --- a/tests/test_background_native_save.py +++ b/tests/test_background_native_save.py @@ -228,11 +228,12 @@ def test_failed_native_save_aborts_load( def test_concurrent_imports_save_in_parallel(client: FlaskClient, native_save: NativeSave) -> None: - """(e) Two imports issued concurrently run their native saves in parallel.""" - first = _import(client, native_save) - second = _import(client, native_save) - for import_call in (first, second): - assert import_call.result().status_code == 200 + """(e) Two imports run their native saves in parallel.""" + # One import after the other: each answers while its native save is blocked, so both saves + # are pending at once. Concurrent requests would write the SQLite database from two threads + # at once, which corrupts it on Windows CI + for _ in range(2): + assert _import(client, native_save).result().status_code == 200 assert native_save.wait_entered(2), "both native saves should run at once" native_save.release.set() with client.application.app_context(): diff --git a/tests/test_utils_functions.py b/tests/test_utils_functions.py index 652b2465..87b788f5 100644 --- a/tests/test_utils_functions.py +++ b/tests/test_utils_functions.py @@ -365,6 +365,8 @@ def test_generate_files_from_non_native_file_twice_shares_geode_id( ) # An unnamed single object takes the file stem assert first["name"] == "hat" + # The native file is saved in background + utils_functions.wait_native_saved(first["id"]) native_path = geode_functions.data_file_path(first["id"], first["native_file"]) reloaded = GeodePolygonalSurface3D.load_one(native_path) assert reloaded.identifier.id().string() == first["geode_id"] @@ -428,6 +430,8 @@ def test_generate_files_from_multi_object_file(client: FlaskClient) -> None: data = Data.get(item["id"]) assert data is not None assert data.geode_id == item["geode_id"] + # The native file is saved in background + utils_functions.wait_native_saved(item["id"]) native_path = geode_functions.data_file_path(item["id"], item["native_file"]) reloaded = GeodeTriangulatedSurface3D.load_one(native_path) assert reloaded.identifier.id().string() == item["geode_id"]