Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,3 @@ werkzeug==3.1.8
# flask
# flask-cors

opengeodeweb-microservice==1.*,>=1.5.0rc1
11 changes: 6 additions & 5 deletions tests/test_background_native_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 4 additions & 0 deletions tests/test_utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down
Loading