From 442cd414e1c84ca6a58b0021688a88f1317fc5e6 Mon Sep 17 00:00:00 2001 From: Francesc Alted Date: Fri, 28 Nov 2025 13:40:11 +0100 Subject: [PATCH 1/2] Set the number of threads to 2 to reduce the test suite runtime. Fixes #535. --- tests/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 8389f8c8..e7365d5c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,6 +14,14 @@ def pytest_configure(config): blosc2.print_versions() + # Using the defaults for nthreads can be very time consuming for tests. + # Fastest runtime (95 sec) for the whole test suite (Mac Mini M4 Pro) + # blosc2.set_nthreads(1) + # Second best runtime (101 sec), but still contained, and + # actually tests multithreading. + blosc2.set_nthreads(2) + # This makes the worst time (242 sec) + # blosc2.set_nthreads(blosc2.nthreads) # worst runtime () @pytest.fixture(scope="session") From 850bcfd1cd43b2ce74057a58e47e071521e0354a Mon Sep 17 00:00:00 2001 From: Francesc Alted Date: Fri, 28 Nov 2025 13:55:18 +0100 Subject: [PATCH 2/2] Only set the number of threads when not in an emscripten platform --- tests/conftest.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index e7365d5c..35768f59 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,6 +6,7 @@ # LICENSE file in the root directory of this source tree) ####################################################################### import os +import sys import pytest @@ -14,14 +15,15 @@ def pytest_configure(config): blosc2.print_versions() - # Using the defaults for nthreads can be very time consuming for tests. - # Fastest runtime (95 sec) for the whole test suite (Mac Mini M4 Pro) - # blosc2.set_nthreads(1) - # Second best runtime (101 sec), but still contained, and - # actually tests multithreading. - blosc2.set_nthreads(2) - # This makes the worst time (242 sec) - # blosc2.set_nthreads(blosc2.nthreads) # worst runtime () + if sys.platform != "emscripten": + # Using the defaults for nthreads can be very time consuming for tests. + # Fastest runtime (95 sec) for the whole test suite (Mac Mini M4 Pro) + # blosc2.set_nthreads(1) + # Second best runtime (101 sec), but still contained, and + # actually tests multithreading. + blosc2.set_nthreads(2) + # This makes the worst time (242 sec) + # blosc2.set_nthreads(blosc2.nthreads) # worst runtime () @pytest.fixture(scope="session")