Skip to content

Commit 27a2151

Browse files
committed
ci(satp-hermes): closed hanging connections
Signed-off-by: Rodolfo Carapau <rodolfo.carapau@gmail.com>
1 parent fc6ac01 commit 27a2151

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

packages/cactus-plugin-satp-hermes/src/main/typescript/cross-chain-mechanisms/bridge/leafs/ethereum-leaf.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,20 @@ export class EthereumLeaf
995995
}
996996
}
997997

998+
public async shutdownConnection(): Promise<void> {
999+
try {
1000+
await this.connector.shutdown();
1001+
this.log.debug(
1002+
`${EthereumLeaf.CLASS_NAME}#shutdownConnection, Connector shutdown successfully`,
1003+
);
1004+
} catch (error) {
1005+
this.log.error(
1006+
`${EthereumLeaf.CLASS_NAME}#shutdownConnection, Error shutting down connector: ${error}`,
1007+
);
1008+
throw error;
1009+
}
1010+
}
1011+
9981012
private isFullPluginOptions = (
9991013
obj: Partial<IPluginLedgerConnectorEthereumOptions>,
10001014
): obj is IPluginLedgerConnectorEthereumOptions => {

packages/cactus-plugin-satp-hermes/src/test/typescript/integration/bridge/besu-leaf.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let besuEnv: BesuTestEnvironment;
2727
const TIMEOUT = 60000;
2828

2929
beforeAll(async () => {
30-
pruneDockerAllIfGithubAction({ logLevel })
30+
await pruneDockerAllIfGithubAction({ logLevel })
3131
.then(() => {
3232
log.info("Pruning throw OK");
3333
})

packages/cactus-plugin-satp-hermes/src/test/typescript/integration/bridge/ethereum-leaf.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let ethereumEnv: EthereumTestEnvironment;
2828
const TIMEOUT = 60000;
2929

3030
beforeAll(async () => {
31-
pruneDockerAllIfGithubAction({ logLevel })
31+
await pruneDockerAllIfGithubAction({ logLevel })
3232
.then(() => {
3333
log.info("Pruning throw OK");
3434
})
@@ -61,6 +61,13 @@ beforeAll(async () => {
6161
afterAll(async () => {
6262
await ethereumEnv.tearDown();
6363

64+
await ethereumLeaf.shutdownConnection().catch((err) => {
65+
log.error("Error shutting down Ethereum Leaf connector:", err);
66+
fail("Error shutting down Ethereum Leaf connector");
67+
});
68+
69+
log.info("Ethereum Leaf connector shutdown successfully");
70+
6471
await pruneDockerAllIfGithubAction({ logLevel })
6572
.then(() => {
6673
log.info("Pruning throw OK");

packages/cactus-plugin-satp-hermes/src/test/typescript/integration/bridge/fabric-leaf.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let fabricEnv: FabricTestEnvironment;
3131
const TIMEOUT = 900000; // 15 minutes
3232

3333
beforeAll(async () => {
34-
pruneDockerAllIfGithubAction({ logLevel })
34+
await pruneDockerAllIfGithubAction({ logLevel })
3535
.then(() => {
3636
log.info("Pruning throw OK");
3737
})

0 commit comments

Comments
 (0)