Skip to content

Commit 63bf37b

Browse files
leowejstriebel
andauthored
Fix macos network tests (#618)
* add download example to docs * expand doc-string * add page to index * add bbox as param * use mags list * Update docs/src/webknossos-py/examples/download_image_data.md Co-authored-by: Jonathan Striebel <[email protected]> * Update docs/src/webknossos-py/examples/download_image_data.md Co-authored-by: Jonathan Striebel <[email protected]> * Update docs/src/webknossos-py/index.md Co-authored-by: Jonathan Striebel <[email protected]> * Update webknossos/webknossos/dataset/dataset.py Co-authored-by: Jonathan Striebel <[email protected]> * add test to test_examples * add assertion * add allowed_hosts * Update downsampling_utils.py * reset downsampling-utils * reformat * add changelog entry * add comment Co-authored-by: Jonathan Striebel <[email protected]>
1 parent a8945c5 commit 63bf37b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
2222
- Inconsistent writes to datasets properties (e.g., caused due to multiprocessing) are detected automatically. The warning can be escalated to an exception with `warnings.filterwarnings("error", module="webknossos", message=r"\[WARNING\]")`. [#633](https://github.com/scalableminds/webknossos-libs/pull/633)
2323

2424
### Fixed
25+
- Tests: The `./test.sh` script works on macOS again and doesn't throw Network Errors anymore. However the introduced fix could lead to slightly different behaviour on macOS tests vs CI tests, when UNIX socket communication is involved. [#618](https://github.com/scalableminds/webknossos-libs/pull/618)
2526

2627

2728
## [0.9.9](https://github.com/scalableminds/webknossos-libs/releases/tag/v0.9.9) - 2022-03-03

webknossos/tests/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import multiprocessing
23
import re
34
import warnings
45
from io import BytesIO
@@ -316,3 +317,12 @@ def pytest_collection_modifyitems(items: List[pytest.Item]) -> None:
316317
for item in items:
317318
if item.get_closest_marker("vcr") is None:
318319
item.add_marker("vcr")
320+
321+
if (
322+
item.get_closest_marker("block_network") is None
323+
and multiprocessing.get_start_method() != "fork"
324+
):
325+
# To allow for UNIX socket communication necessary for spawn multiprocessing
326+
# addresses starting with `/` are allowed
327+
marker = pytest.mark.block_network(allowed_hosts=["/.*"])
328+
item.add_marker(marker)

0 commit comments

Comments
 (0)