Skip to content

Commit 8e77227

Browse files
committed
Fix benchmark execution: use Maven profile instead of -Dgroups
-Dgroups=benchmark doesn't work because surefire's <excludedGroups> takes precedence over command-line includedGroups. Added a 'benchmark' Maven profile that overrides both <excludes> and <excludedGroups> and sets <groups>benchmark</groups>. Run benchmarks: mvn test -Pbenchmark (requires Docker) https://claude.ai/code/session_01RyMeX221wTfN1atWi98YK2
1 parent 71c70df commit 8e77227

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

AUDIT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ End-to-end HTTP latency measured with `CyclesProtocolBenchmarkTest` (Spring Boot
258258
- Results are from a containerized CI environment (Testcontainers Redis 7-Alpine, localhost networking). Production with dedicated Redis will be faster.
259259
- Latencies include full HTTP round-trip: Spring Boot request handling, auth filter, JSON serialization, Redis EVALSHA, Lua execution, response building.
260260
- The BCrypt cache eliminates ~100ms+ from all operations after the first request per API key (60s cache window).
261-
- Run benchmarks: `mvn test -Dgroups=benchmark` (requires Docker)
261+
- Run benchmarks: `mvn test -Pbenchmark` (requires Docker)
262262
- Benchmarks are excluded from default `mvn verify` builds via `<excludedGroups>benchmark</excludedGroups>` in surefire config
263263

264264
### Production Hardening (Phase 2 audit)

cycles-protocol-service/cycles-protocol-service-api/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,21 @@
9494
</plugins>
9595
</build>
9696
</profile>
97+
<profile>
98+
<id>benchmark</id>
99+
<build>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-surefire-plugin</artifactId>
104+
<configuration>
105+
<excludes combine.self="override" />
106+
<excludedGroups combine.self="override" />
107+
<groups>benchmark</groups>
108+
</configuration>
109+
</plugin>
110+
</plugins>
111+
</build>
112+
</profile>
97113
</profiles>
98114
</project>

cycles-protocol-service/cycles-protocol-service-api/src/test/java/io/runcycles/protocol/api/CyclesProtocolBenchmarkTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Results are environment-dependent (CI vs local, container overhead, etc.).
1919
* Use these numbers as relative guidance, not absolute SLA targets.
2020
*
21-
* Run separately: mvn test -Dgroups=benchmark
21+
* Run separately: mvn test -Pbenchmark
2222
*/
2323
@DisplayName("Performance Benchmarks")
2424
@Tag("benchmark")

cycles-protocol-service/cycles-protocol-service-api/src/test/java/io/runcycles/protocol/api/CyclesProtocolConcurrentBenchmarkTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Results are CI-environment sensitive — latency and throughput depend on
2525
* container resources, Redis container networking, and JVM warm-up.
2626
*
27-
* Run separately: mvn test -Dgroups=benchmark
27+
* Run separately: mvn test -Pbenchmark
2828
*/
2929
@DisplayName("Concurrent Load Benchmarks")
3030
@Tag("benchmark")

0 commit comments

Comments
 (0)