Skip to content

Commit

Permalink
Remove concurrency handling from Makefile stestr usage (#10097)
Browse files Browse the repository at this point in the history
In #1973 the Makefile was updated to add manual concurrency handling to
the invocation of stestr. At the time (> 4 yrs ag) our CI setup looked
very different, everything was run in TravisCI which had much smaller
memory quotas in the worker VMs and we also were actively using the
Makefile to run tests. Since that time though CI and our development
workflow have changed. At the time running multiple tests in parallel
was causing us to exhaust the available RAM in the CI workers for MacOS
and Windows so we set concurrency limits to prevent this. However, we no
longer use travis, and the use of the makefile has long since been replaced
by using tox as it provides a unified interface that manges venvs along
with running tests in a consistent way across systems (including locally
and CI). This commit reverts that change and lets stestr run with it's
default concurrency when people use the Makefile. While the Makefile isn't
widely used and has been largely superseded by tox, there are still some
people using it and of those using MacOS or Windows this should improve
local test throughput.
  • Loading branch information
mtreinish authored May 10, 2023
1 parent 06a5b9e commit 2b18980
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,6 @@

OS := $(shell uname -s)

ifeq ($(OS), Linux)
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
else ifeq ($(OS), Darwin)
NPROCS := 2
else
NPROCS := 0
endif # $(OS)

ifeq ($(NPROCS), 2)
CONCURRENCY := 2
else ifeq ($(NPROCS), 1)
CONCURRENCY := 1
else ifeq ($(NPROCS), 3)
CONCURRENCY := 3
else ifeq ($(NPROCS), 0)
CONCURRENCY := 0
else
CONCURRENCY := $(shell echo "$(NPROCS) 2" | awk '{printf "%.0f", $$1 / $$2}')
endif

.PHONY: default env lint lint-incr style black test test_randomized pytest pytest_randomized test_ci coverage coverage_erase clean

default: style lint-incr test ;
Expand Down Expand Up @@ -87,8 +67,7 @@ pytest_randomized:
pytest test/randomized

test_ci:
@echo Detected $(NPROCS) CPUs running with $(CONCURRENCY) workers
QISKIT_TEST_CAPTURE_STREAMS=1 stestr run --concurrency $(CONCURRENCY)
QISKIT_TEST_CAPTURE_STREAMS=1 stestr run

test_randomized:
python3 -m unittest discover -s test/randomized -t . -v
Expand Down

0 comments on commit 2b18980

Please sign in to comment.