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
33 changes: 30 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ jobs:

# Every OS runs the full reactor, the vortex-jni cross-checks included: vortex-jni ships
# native libs for darwin-aarch64, linux-aarch64, linux-amd64 and win-amd64. bash, so
# ./mvnw is the same script everywhere.
# ./mvnw is the same script everywhere. Checkstyle and javadoc give the same answer on every
# OS and JDK, so they run once, in the checks job below.
- name: Build and test
shell: bash
env:
VORTEX_TEST_CACHE: ${{ runner.temp }}/vortex-test-cache
run: ./mvnw verify
run: ./mvnw verify -Dcheckstyle.skip -Dmaven.javadoc.skip=true

# The test JVMs add jdk.incubator.vector; users get the auto-vectorized kernels unless they opt in.
# This leg runs the modules that call the kernels (core, reader, writer; -am adds fsst) again
Expand All @@ -62,4 +63,30 @@ jobs:
# kernel tests check them against each other.
- name: Build and test without the Vector API module
if: matrix.os == 'ubuntu-latest' && matrix.java-version == '25'
run: ./mvnw verify -Dtest.vector.args= -pl core,reader,writer -am
run: ./mvnw verify -Dtest.vector.args= -pl core,reader,writer -am -Dcheckstyle.skip -Dmaven.javadoc.skip=true

# Checkstyle and javadoc (errors and warnings both fail), once instead of in each build job: they
# read the sources, not the platform. Next to the builds, not after them, so they add no time
# to the run; the run is green only when this job is too.
checks:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Set up Azul Zulu JDK 25
uses: actions/setup-java@v6.3.0
with:
distribution: zulu
java-version: '25'

- name: Cache Maven repository
uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Checkstyle and javadoc
run: ./mvnw verify -DskipTests
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,11 @@ Generated proto records live in `io.github.dfa1.vortex.core.proto`; the runtime
- **Large arrays: `isEqualTo`, never `containsExactly`.** AssertJ's `containsExactly` is O(n²) even when
it passes: on 500k elements it costs ~20 s locally and ~80 s on CI (`RepartitionerTest` 19 s → 0.1 s,
`DictLayoutInteropIntegrationTest` 82 s on CI, 43 s → 3 s locally). `isEqualTo` on arrays is a linear `Arrays.equals`.
- **Integration test classes run concurrently** (`integration/src/test/resources/junit-platform.properties`),
so no mutable static state and no global JVM settings (system properties, default locale); a class that
needs the JVM to itself takes `@Isolated`. vortex-jni scans are **unordered by default**
- **Test classes run concurrently**, unit (the parent pom's surefire parameters) and integration
(`integration/src/test/resources/junit-platform.properties`) alike, so no mutable static state and no
global JVM settings (system properties, default locale); a class that needs the JVM to itself takes
`@Isolated`, as every JFR events test does through `JfrRecorderBase`. `cli` (its tests swap
`System.out`/`System.err`) and `fuzz` (Jazzer) run one class at a time. vortex-jni scans are **unordered by default**
(`ScanOptions#ordered()` is `false`) and do reorder under that load: wrap the options with the integration
module's `JniScans` helper, or set `ordered(true)`, whenever the result is compared row by row.
- `@Nested` groups related scenarios (`@BeforeEach` in a nested class applies only to it). Private
Expand Down
8 changes: 8 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@
<include>**/*Test.java</include>
<include>**/*IT.java</include>
</includes>
<!-- One class at a time: the tests capture a command's output by swapping
System.out and System.err, which the whole JVM shares (the parent runs
classes concurrently). -->
<properties>
<configurationParameters combine.self="override">
junit.jupiter.execution.parallel.enabled=false
</configurationParameters>
</properties>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jdk.jfr.consumer.RecordingFile;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.parallel.Isolated;

import java.io.IOException;
import java.io.UncheckedIOException;
Expand All @@ -15,6 +16,10 @@
/// Base class for tests that assert on the `io.github.dfa1.vortex.*` JFR events: a [Recording]
/// runs around each test, and [#events(String)] dumps it, so every event committed before the
/// call is there (a streaming consumer would race the commits).
///
/// [Isolated] (inherited): a recording sees every thread's events, so a test class running
/// alongside it would add its own; the class runs with no other test class at the same time.
@Isolated
public abstract class JfrRecorderBase {

private static final String PREFIX = "io.github.dfa1.vortex.";
Expand Down
19 changes: 19 additions & 0 deletions fuzz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,23 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- One class at a time: Jazzer instruments and drives the JVM while it fuzzes, so
its targets do not share the JVM with each other (the parent runs classes
concurrently). -->
<properties>
<configurationParameters combine.self="override">
junit.jupiter.execution.parallel.enabled=false
</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
</build>

</project>
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,19 @@
by {@code maven-dependency-plugin:properties} (declared in build/plugins);
loading it as a javaagent suppresses the Mockito self-attach warning. -->
<argLine>@{argLine} -javaagent:${net.bytebuddy:byte-buddy-agent:jar} ${test.vector.args} ${test.native.args} ${test.unsafe.args}</argLine>
<!-- Unit test classes run concurrently, one per core, and the methods of a class
one after another, as the integration module's do: a class that cannot share
the JVM opts out with @Isolated. Passed as launcher parameters, these win over a
module's junit-platform.properties; fuzz turns them off in its own pom. -->
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=same_thread
junit.jupiter.execution.parallel.mode.classes.default=concurrent
junit.jupiter.execution.parallel.config.strategy=dynamic
junit.jupiter.execution.parallel.config.dynamic.factor=1
</configurationParameters>
</properties>
</configuration>
</plugin>
<plugin>
Expand Down
Loading