Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/run-checks-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
echo "lucene.tool.ast-grep=ast-grep" >> build-options.local.properties

- name: Run gradle check (without tests)
run: ./gradlew check -x test "-Ptask.times=true" --max-workers 2
run: ./gradlew check -x test "-Ptask.times=true"


# This runs all tests without any other validation checks.
Expand Down Expand Up @@ -87,8 +87,20 @@ jobs:
- name: Configure tools
uses: ./.github/actions/prepare-for-build

- name: Speedup MacOS runner
if: ${{ runner.os == 'macOS' }}
run: |
mkdir /tmp/tmpfs
sudo mount_tmpfs -o noowners -s 1g /tmp/tmpfs
sudo sysctl debug.lowpri_throttle_enabled=0
echo "tests.workDir=/tmp/tmpfs/lucene" >> build-options.local.properties

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for using these local build option overrides.


- name: Run gradle tests
run: ./gradlew test "-Ptask.times=true" "-Pvalidation.errorprone=false" --max-workers 2
run: ./gradlew test "-Ptask.times=true" "-Pvalidation.errorprone=false"
env:
# Set to the defaults to override the "CI"-based logic that would enable C2
# we can't afford C2 on github runners.
TEST_JVM_ARGS: "-XX:TieredStopAtLevel=1 -XX:+UseParallelGC -XX:ActiveProcessorCount=1"

- name: List automatically-initialized gradle.properties
run: cat gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public void run(Path source, Path destination) throws IOException {
}

// Approximate a common-sense default for running gradle/tests with parallel
// workers: half the count of available cpus but not more than 12.
// workers: the count of available cpus but not more than 12.
var cpus = Runtime.getRuntime().availableProcessors();
var maxWorkers = (int) Math.max(1d, Math.min(cpus * 0.5d, 12));
var testsJvms = (int) Math.max(1d, Math.min(cpus * 0.5d, 12));
var maxWorkers = Math.min(cpus, 12);
var testsJvms = Math.min(cpus, 12);

var replacements = Map.of("@MAX_WORKERS@", maxWorkers, "@TEST_JVMS@", testsJvms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ public void apply(Project project) {
.getProviders()
.provider(
() -> {
return ((int)
Math.max(
1, Math.min(Runtime.getRuntime().availableProcessors() / 2.0, 4.0)));
return Math.min(12, Runtime.getRuntime().availableProcessors());
}));

// GITHUB#13986: Allow easier configuration of the Panama Vectorization provider with newer Java
Expand Down
4 changes: 2 additions & 2 deletions gradle/template.gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
###############
#
# Gradle build can run tasks in parallel but by default it consumes all CPU cores which
# is too optimistic a default for Lucene tests. You can disable the parallelism
# may be too optimistic a default for Lucene tests. You can disable the parallelism
# entirely or assign it a 'low' priority with these properties:
#
# org.gradle.parallel=[true, false]
# org.gradle.priority=[normal, low]
#
# The default level of parallelism is computed based on the number of cores on
# your machine (on the first run of gradle build). By default these are fairly conservative
# settings (half the number of cores for workers, for example):
# settings (the number of cores for workers up to a limit of 12, for example):
#
# org.gradle.workers.max=[X]
# tests.jvms=[N <= X]
Expand Down
Loading