diff --git a/.cspell.json b/.cspell.json index f5c9a3b586..b5787e7781 100644 --- a/.cspell.json +++ b/.cspell.json @@ -45,9 +45,12 @@ "couchdb", "COUCHDBADDRESS", "COUCHDBCONFIG", + "CPIV", "cplcs", "Creds", "Crpc", + "CSDE", + "csdetemplate", "data", "davecgh", "dclm", @@ -187,6 +190,7 @@ "undici", "unixfs", "Unmarshal", + "utxoexample", "uuidv", "vscc", "vuln", diff --git a/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts b/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts index beaa9e8b55..0b4c5b4feb 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts @@ -73,9 +73,6 @@ describe("Corda Test Case", () => { const timeout = 180000; // 3 minutes const cwd = "/CSDE-cordapp-template-kotlin"; shortHashID = await Containers.exec(container, cmd, timeout, logLevel, cwd); - // TODO: Remove the timeout below. This is a temporary fix to the flakiness of the test. - // Will do further investigation on this issue - await new Promise((resolve) => setTimeout(resolve, 60000)); }); describe("Endpoint Testing", () => { diff --git a/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts b/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts index a708e83db8..57c452be1a 100644 --- a/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts +++ b/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts @@ -33,8 +33,8 @@ export interface ICordaV5TestLedgerConstructorOptions { * Provides default options for Corda container */ const DEFAULTS = Object.freeze({ - imageVersion: "38c5858", - imageName: "ghcr.io/hyperledger/cactus-corda-5-all-in-one-alpha-2024-05-22", + imageVersion: "2024-06-18-issue3293-3e1660df4", + imageName: "ghcr.io/hyperledger/cacti-corda-5-all-in-one", publicPort: 8888, postgresPort: 5431, rpcPortA: 10008, diff --git a/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh b/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh index e73a66ef35..5ab3f7cf08 100755 --- a/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh +++ b/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh @@ -1,10 +1,11 @@ -# #!/bin/bash +#!/bin/bash set -e -# Function to check if all nodes are up and running +gradleOutput="" + +# Check if all nodes are up and running checkNodesStatus() { - local gradleOutput - # Run Gradle task and get the output + # Run Gradle task and capture the output cd /CSDE-cordapp-template-kotlin/ gradleOutput=$(./gradlew listVNodes) echo "gradleOutput: $gradleOutput" @@ -14,7 +15,6 @@ checkNodesStatus() { # Check if all 5 nodes are up and running if [ "$upAndRunningCount" -eq 5 ]; then echo "All 5 nodes are up and running." - exit 0 else echo "Waiting for all nodes to be up and running..." sleep 5 @@ -22,4 +22,27 @@ checkNodesStatus() { fi } -checkNodesStatus \ No newline at end of file +# Check if request is successful +checkCurlSuccess() { + echo "Executing checkCurlSuccess function..." + local holding_identity_shorthash_test + holding_identity_shorthash_test=$(echo "$gradleOutput" | grep -oE '\b[0-9A-F]{12}\b' | tail -n 1) + local response_code + response_code=$(curl -k -s -o /dev/null -w "%{http_code}" -u admin:admin "https://localhost:8888/api/v1/members/$holding_identity_shorthash_test/group-parameters") + if [ "$response_code" -eq 200 ]; then + echo "CURL request successful." + else + echo "CURL request failed with response code: $response_code" + exit 1 + fi +} + +checkNodesStatus + +checkCurlSuccess + +WAIT_TIME=30 +echo "Waiting for $WAIT_TIME seconds to ensure stability before exiting with status code 0..." +sleep $WAIT_TIME + +exit 0 \ No newline at end of file