Allow the full tests/fork-parallel to pass on less than four cores

The test will be meaningless on less than four cores, but the
scripted test will pass. On four or more cores, the test wil
test testForkedParallel as expected.

Closes #3545
This commit is contained in:
Antonio Cunei 2018-01-30 23:59:37 +01:00
parent 5d89795657
commit c310ade9f8
2 changed files with 5 additions and 14 deletions

View File

@ -13,6 +13,8 @@ lazy val root = (project in file(".")).
val log = streams.value.log
if( nbProc < 4 ) {
log.warn("With fewer than 4 processors this test is meaningless")
// mimic behavior expected by scripted
if (!testForkedParallel.value) sys.error("Exiting with error (note: test not performed)")
} else {
// we've got at least 4 processors, we'll check the upper end but also 3 and 4 as the upper might not
// be reached if the system is under heavy load.

View File

@ -1,18 +1,7 @@
# The tests/fork-parallel test will currently always
# report success when run on less than four cores,
# rather than failing in one of the two cases as expected.
# TODO: Adjust this scripted test so that it works as
# intended on less than four cores as well.
# To debug, it is possible to limit the number of cores
# reported to sbt, and run the test, by using:
# taskset 0x00000003 sbt 'scripted tests/fork-parallel'
# See: https://github.com/sbt/sbt/issues/3545
# This bit won't currently work when using less than four cores.
# > test
# -> check
# Note: this test is meaningless on less than four cores
> test
-> check
> clean
> set testForkedParallel := true
> test