Skip to content

Commit f6f0f00

Browse files
authored
Merge pull request #790 from ascopes/task/enable-parallel-it-execution
Re-enable parallel test execution for integration tests
2 parents 0df8908 + 8305448 commit f6f0f00

6 files changed

Lines changed: 30 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
160160
- name: Build and test
161161
shell: bash
162-
run: ./mvnw -B -Dcheckstyle.skip -Dlicense.skip clean verify
162+
run: time ./mvnw -B -Dcheckstyle.skip -Dlicense.skip clean verify
163163

164164
- name: Publish code coverage
165165
uses: codecov/codecov-action@v4

protobuf-maven-plugin/pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,15 @@
188188
<failIfNoProjects>true</failIfNoProjects>
189189
<!-- Warning: placing this inside the cloneProjectsTo path triggers a resolution bug in the plugin -->
190190
<localRepositoryPath>${project.basedir}/target/it-repo</localRepositoryPath>
191-
<!-- Set to 1 for now to avoid flaky builds on GitHub. -->
192-
<parallelThreads>1</parallelThreads>
191+
<parallelThreads>2C</parallelThreads>
193192
<postBuildHookScript>test</postBuildHookScript>
194193
<properties>
195-
<!-- Acquire locks where-ever we run Maven to avoid parallel tests trampling across eachother. -->
194+
<!-- Acquire locks whereever we run Maven to avoid parallel tests trampling across eachother. -->
196195
<aether.syncContext.named.factory>file-lock</aether.syncContext.named.factory>
197196
<aether.syncContext.named.nameMapper>file-gav</aether.syncContext.named.nameMapper>
197+
<!-- Avoid https://bugs.openjdk.org/browse/JDK-8252883 on Windows -->
198+
<aether.named.file-lock.attempts>10</aether.named.file-lock.attempts>
199+
<aether.named.file-lock.sleepMillis>500</aether.named.file-lock.sleepMillis>
198200
</properties>
199201
<setupIncludes>
200202
<setupInclude>setup</setupInclude>

protobuf-maven-plugin/src/it/gh-782-sanctioned-executable-paths/src/test/java/org/example/helloworld/ReactorGreetingServiceImplTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ void greetingServiceWorksAsExpected() throws Throwable {
2727
// Given
2828
var service = new ReactorGreetingServiceImpl();
2929
var server = ServerBuilder
30-
.forPort(8084)
30+
.forPort(0)
3131
.addService(service)
3232
.build();
33-
var channel = ManagedChannelBuilder.forAddress("localhost", 8084)
34-
.usePlaintext()
35-
.build();
36-
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
3733

3834
try {
3935
server.start();
4036

37+
var channel = ManagedChannelBuilder.forAddress("localhost", server.getPort())
38+
.usePlaintext()
39+
.build();
40+
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
41+
4142
// When
4243
var request = GreetingRequest
4344
.newBuilder()

protobuf-maven-plugin/src/it/per-plugin-output-paths/src/test/java/org/example/helloworld/ReactorGreetingServiceImplTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ void greetingServiceWorksAsExpected() throws Throwable {
2727
// Given
2828
var service = new ReactorGreetingServiceImpl();
2929
var server = ServerBuilder
30-
.forPort(8083)
30+
.forPort(0)
3131
.addService(service)
3232
.build();
33-
var channel = ManagedChannelBuilder.forAddress("localhost", 8083)
34-
.usePlaintext()
35-
.build();
36-
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
3733

3834
try {
3935
server.start();
4036

37+
var channel = ManagedChannelBuilder.forAddress("localhost", server.getPort())
38+
.usePlaintext()
39+
.build();
40+
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
41+
4142
// When
4243
var request = GreetingRequest
4344
.newBuilder()

protobuf-maven-plugin/src/it/reactor-grpc-binary-plugin/src/test/java/org/example/helloworld/ReactorGreetingServiceImplTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ void greetingServiceWorksAsExpected() throws Throwable {
2727
// Given
2828
var service = new ReactorGreetingServiceImpl();
2929
var server = ServerBuilder
30-
.forPort(8083)
30+
.forPort(0)
3131
.addService(service)
3232
.build();
33-
var channel = ManagedChannelBuilder.forAddress("localhost", 8083)
34-
.usePlaintext()
35-
.build();
36-
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
3733

3834
try {
3935
server.start();
4036

37+
var channel = ManagedChannelBuilder.forAddress("localhost", server.getPort())
38+
.usePlaintext()
39+
.build();
40+
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
41+
4142
// When
4243
var request = GreetingRequest
4344
.newBuilder()

protobuf-maven-plugin/src/it/reactor-grpc-jvm-plugin/src/test/java/org/example/helloworld/ReactorGreetingServiceImplTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ void greetingServiceWorksAsExpected() throws Throwable {
2727
// Given
2828
var service = new ReactorGreetingServiceImpl();
2929
var server = ServerBuilder
30-
.forPort(8084)
30+
.forPort(0)
3131
.addService(service)
3232
.build();
33-
var channel = ManagedChannelBuilder.forAddress("localhost", 8084)
34-
.usePlaintext()
35-
.build();
36-
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
3733

3834
try {
3935
server.start();
4036

37+
var channel = ManagedChannelBuilder.forAddress("localhost", server.getPort())
38+
.usePlaintext()
39+
.build();
40+
var stub = ReactorGreetingServiceGrpc.newReactorStub(channel);
41+
4142
// When
4243
var request = GreetingRequest
4344
.newBuilder()

0 commit comments

Comments
 (0)