Skip to content

Commit b6b7f4a

Browse files
dkasimovskiyclaude
andcommitted
fix(tests): drop cross-module test-jar dep, copy helper locally
The previous commit added <type>test-jar</type> dependencies on tarantool-core in client and jackson-mapping pom.xml. The maven-jar-plugin only produces the test-jar artifact during the `package` phase, which `mvn test` (used by CI's unit profile) does not reach. Downstream modules therefore fail with "Could not find artifact ... in central-portal-snapshots". Replace the cross-module test-jar deps with a copy of TimerShutdownHook in each of the four modules' own test sources (the same pattern already used for tarantool-schema in the previous commit). This matches the plan's "Option A" recommendation that was originally only applied to schema. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent eaca16c commit b6b7f4a

6 files changed

Lines changed: 60 additions & 16 deletions

File tree

tarantool-client/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
<groupId>io.tarantool</groupId>
2626
<artifactId>tarantool-core</artifactId>
2727
</dependency>
28-
<dependency>
29-
<groupId>io.tarantool</groupId>
30-
<artifactId>tarantool-core</artifactId>
31-
<version>${project.version}</version>
32-
<type>test-jar</type>
33-
<scope>test</scope>
34-
</dependency>
3528
<dependency>
3629
<groupId>io.tarantool</groupId>
3730
<artifactId>tarantool-jackson-mapping</artifactId>

tarantool-client/src/test/java/io/tarantool/client/integration/TarantoolCrudClientWithRetryTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import io.tarantool.client.crud.TarantoolCrudSpace;
3434
import io.tarantool.client.factory.TarantoolFactory;
3535
import io.tarantool.core.exceptions.BoxError;
36-
import io.tarantool.core.integration.TimerShutdownHook;
3736
import io.tarantool.mapping.Tuple;
3837

3938
@Timeout(value = 5)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2026 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY
3+
* All Rights Reserved.
4+
*/
5+
6+
package io.tarantool.client.integration;
7+
8+
import java.util.Set;
9+
import java.util.function.Supplier;
10+
11+
import io.netty.util.Timeout;
12+
import io.netty.util.Timer;
13+
14+
public final class TimerShutdownHook {
15+
private TimerShutdownHook() {}
16+
17+
public static void register(Supplier<Timer> timerRef, String name) {
18+
Runtime.getRuntime()
19+
.addShutdownHook(
20+
new Thread(
21+
() -> {
22+
Timer t = timerRef.get();
23+
if (t != null) {
24+
Set<Timeout> pending = t.stop();
25+
if (pending != null) pending.forEach(Timeout::cancel);
26+
}
27+
},
28+
name));
29+
}
30+
}

tarantool-jackson-mapping/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
<groupId>io.tarantool</groupId>
2626
<artifactId>tarantool-core</artifactId>
2727
</dependency>
28-
<dependency>
29-
<groupId>io.tarantool</groupId>
30-
<artifactId>tarantool-core</artifactId>
31-
<version>${project.version}</version>
32-
<type>test-jar</type>
33-
<scope>test</scope>
34-
</dependency>
3528
<dependency>
3629
<groupId>org.msgpack</groupId>
3730
<artifactId>jackson-dataformat-msgpack</artifactId>

tarantool-jackson-mapping/src/test/java/io/tarantool/mapping/integration/BaseTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import io.netty.util.Timer;
1818

1919
import io.tarantool.core.connection.ConnectionFactory;
20-
import io.tarantool.core.integration.TimerShutdownHook;
2120

2221
public abstract class BaseTest {
2322

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2026 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY
3+
* All Rights Reserved.
4+
*/
5+
6+
package io.tarantool.mapping.integration;
7+
8+
import java.util.Set;
9+
import java.util.function.Supplier;
10+
11+
import io.netty.util.Timeout;
12+
import io.netty.util.Timer;
13+
14+
public final class TimerShutdownHook {
15+
private TimerShutdownHook() {}
16+
17+
public static void register(Supplier<Timer> timerRef, String name) {
18+
Runtime.getRuntime()
19+
.addShutdownHook(
20+
new Thread(
21+
() -> {
22+
Timer t = timerRef.get();
23+
if (t != null) {
24+
Set<Timeout> pending = t.stop();
25+
if (pending != null) pending.forEach(Timeout::cancel);
26+
}
27+
},
28+
name));
29+
}
30+
}

0 commit comments

Comments
 (0)