DEV: Cap qunit concurrency at 8 browsers (#28635)

`ember exam` points all browsers at a single ember-cli server process. With very high parallelism, we've started seeing `ChunkLoadError` exceptions, which may indicate the server being overloaded. Capping to 8 browsers to avoid that.
This commit is contained in:
David Taylor 2024-08-29 12:00:54 +01:00 committed by GitHub
parent 4f705b3146
commit 07de0db5e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 2 deletions

View File

@ -82,6 +82,12 @@ def number_of_processors
Etc.nprocessors
end
def qunit_concurrency
# qunit runs all browsers against a single ember-cli (express.js) server, so this will not scale infinitely
# therefore, cap at 8
[number_of_processors / 2, 8].min
end
def system_tests_parallel_tests_processors_env
"PARALLEL_TEST_PROCESSORS=#{number_of_processors / 2}"
end
@ -298,7 +304,7 @@ task "docker:test" do
unless ENV["SKIP_CORE"]
@good &&=
run_or_fail(
"cd app/assets/javascripts/discourse && CI=1 yarn ember exam --load-balance --parallel=#{number_of_processors / 2} --random",
"cd app/assets/javascripts/discourse && CI=1 yarn ember exam --load-balance --parallel=#{qunit_concurrency} --random",
)
end
@ -311,7 +317,7 @@ task "docker:test" do
else
@good &&=
run_or_fail(
"QUNIT_PARALLEL=#{number_of_processors / 2} CI=1 bundle exec rake plugin:qunit['*','#{js_timeout}']",
"QUNIT_PARALLEL=#{qunit_concurrency} CI=1 bundle exec rake plugin:qunit['*','#{js_timeout}']",
)
end
end