hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
340 stars 281 forks source link

test(connector-ethereum): fix verifier-integration-with-ethereum-connector.test #2656

Closed petermetz closed 1 year ago

petermetz commented 1 year ago

Summary

The cactus-test-plugin-ledger-connector-ethereum CI job times out after 6 hours which means that there are tests that do not clean up resources properly after themselves (most often it is an HTTP listener that is left on listening forever after a test failure, but it could be a million other things as well).

There are two issues here (most likely):

  1. Some tests are failing
  2. Some tests are not cleaning up after themselves properly and that leaves the execution to go on forever. Most likely culprit here are the failing tests but it could be the ones that are succeeding and then forgetting to clean-up resources so do check out every possibility.

Full Log File from the CI

2023-09-06T06-16-09_cacti_ci_connector_ethereum_6_hours_time_out.crash.log

Interesting Sections of the Log (Non-Exhaustive List)

2023-09-06T09:35:52.7306383Z FAIL packages/cactus-test-plugin-ledger-connector-ethereum/src/test/typescript/integration/api-client/verifier-integration-with-ethereum-connector.test.ts (10927.138 s)
2023-09-06T09:35:52.7314910Z   ● Verifier integration with ethereum connector tests › Verifier of EthereumApiClient is created by VerifierFactory
2023-09-06T09:35:52.7315441Z 
2023-09-06T09:35:52.7315843Z     expect(received).toEqual(expected) // deep equality
2023-09-06T09:35:52.7316173Z 
2023-09-06T09:35:52.7316420Z     Expected: "EthereumApiClient"
2023-09-06T09:35:52.7316868Z     Received: "QuorumApiClient"
2023-09-06T09:35:52.7317147Z 
2023-09-06T09:35:52.7317567Z       232 |   test("Verifier of EthereumApiClient is created by VerifierFactory", () => {
2023-09-06T09:35:52.7318268Z       233 |     const sut = globalVerifierFactory.getVerifier(ethereumValidatorId);
2023-09-06T09:35:52.7318968Z     > 234 |     expect(sut.ledgerApi.className).toEqual("EthereumApiClient");
2023-09-06T09:35:52.7319479Z           |                                     ^
2023-09-06T09:35:52.7319827Z       235 |   });
2023-09-06T09:35:52.7320147Z       236 |
2023-09-06T09:35:52.7320571Z       237 |   describe("web3EthContract tests", () => {
2023-09-06T09:35:52.7320877Z 
2023-09-06T09:35:52.7321897Z       at Object.<anonymous> (packages/cactus-test-plugin-ledger-connector-ethereum/src/test/typescript/integration/api-client/verifier-integration-with-ethereum-connector.test.ts:234:37)
2023-09-06T09:35:52.7322552Z 
2023-09-06T09:36:31.0511432Z FAIL packages/cactus-test-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/deploy-contract-via-web-service.test.ts (38.309 s)
2023-09-06T09:36:31.0512569Z   ● deploys contract via REST API › deploys contract via REST API
2023-09-06T09:36:31.0512906Z 
2023-09-06T09:36:31.0513234Z     Failed to start ApiServer: RuntimeError: Binding gRPC failed:
2023-09-06T09:36:31.0513552Z 
2023-09-06T09:36:31.0513753Z       635 |           if (error) {
2023-09-06T09:36:31.0514193Z       636 |             this.log.error("Binding gRPC failed: ", error);
2023-09-06T09:36:31.0514735Z     > 637 |             return reject(new RuntimeError("Binding gRPC failed: ", error));
2023-09-06T09:36:31.0515171Z           |                           ^
2023-09-06T09:36:31.0515486Z       638 |           }
2023-09-06T09:36:31.0515871Z       639 |           this.grpcServer.addService(
2023-09-06T09:36:31.0516397Z       640 |             default_service.org.hyperledger.cactus.cmd_api_server
2023-09-06T09:36:31.0516720Z 
2023-09-06T09:36:31.0517161Z       at packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:637:27
2023-09-06T09:36:31.0518118Z       at packages/cactus-cmd-api-server/node_modules/@grpc/grpc-js/src/server.ts:419:30
2023-09-06T09:36:31.0518917Z       at ApiServer.start (packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:254:13)
2023-09-06T09:36:31.0519602Z           at runMicrotasks (<anonymous>)
2023-09-06T09:36:31.0520721Z       at Object.<anonymous> (packages/cactus-test-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/deploy-contract-via-web-service.test.ts:123:25)
2023-09-06T09:36:31.0521323Z 

cc: @takeutak @izuru0 @outSH @sandeepnRES @VRamakrishna

outSH commented 1 year ago

@petermetz Assign this to me please, I'll try to fix this in https://github.com/hyperledger/cacti/pull/2581