New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: limit test-run jobs number to CPU count #7494
base: master
Are you sure you want to change the base?
Conversation
5c621fe
to
c371512
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaroslav, thanks for the patch!
Before this change test-run always ran with its default value
for jobs number - 2 x CPU count. However, such a value may potentially
lead to flaking test results and it really annoys everyone. So it was
decided to give a chance to this patch and see what would happen.
Without proofs, it is just a hypothesis.
I see another value in your patch - ability to set number of jobs for compiler, test-run.py
, prove
(using in LuaJIT) in a single place.
add_custom_target(test-unit | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use symbol =
in --jobs
as in --builddir
option? The same below.
|
||
# Get the test-run jobs count from the env variable. If the variable is not | ||
# defined, use the CPU count instead. If the ProcessorCount fails to determine | ||
# the number of cores, it yields 0, which means for test-run 2 x CPU count. | ||
set(TEST_RUN_JOBS $ENV{TEST_RUN_JOBS}) | ||
if(NOT TEST_RUN_JOBS) | ||
include(ProcessorCount) | ||
ProcessorCount(TEST_RUN_JOBS) | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -17,6 +17,7 @@ MAX_PROCS ?= 2048 | |||
MAX_FILES ?= 4096 | |||
|
|||
VARDIR ?= /tmp/t | |||
TEST_RUN_JOBS ?= ${NPROC} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How it is supposed to work? It is not clear what is a ${NPROC}
and where it is set.
# Get the test-run jobs count from the env variable. If the variable is not | ||
# defined, use the CPU count instead. If the ProcessorCount fails to determine | ||
# the number of cores, it yields 0, which means for test-run 2 x CPU count. | ||
set(TEST_RUN_JOBS $ENV{TEST_RUN_JOBS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is better to have a single variable with number of jobs for everything: compilers, test-run.py, prove etc.
I can't imagine reasons to set a separate number of jobs for all three things.
9dd02bd
to
61daa32
Compare
587e260
to
90dbaaa
Compare
This patch is intended to limit the number of test-run jobs to the CPU count. Before this change test-run always ran with its default value for jobs number - 2 x CPU count. However, such a value may potentially lead to flaking test results and it really annoys everyone. So it was decided to give a chance to this patch and see what would happen. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff
90dbaaa
to
b744fc5
Compare
Issue tarantool/tarantool-qa#80 seems to be related. |
This patch is intended to limit the number of test-run jobs to the CPU
count. Before this change test-run always ran with its default value
for jobs number -
2 x CPU count
. However, such a value may potentiallylead to flaking test results and it really annoys everyone. So it was
decided to give a chance to this patch and see what would happen.
NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff