Skip to content

Commit 006290a

Browse files
petermetzRafaelAPB
authored andcommitted
fix(test): flaky fabric AIO container boot hyperledger-cacti#876
Epic facepalm once again. Turns out the default restart try count of supervisord is too low which leads to race conditions. Increasing the retry count from 4 to 20 should do it, this way the fabric-network process (see supervisord.conf file) should be 5 times as "patient" waiting for the docker daemon to launch within the AIO container. What was happening before is that the fabric-network script tried launching itself in parallel with the docker daemon, but it would time out before the docker daemon could come online. Published these images as ghcr.io/hyperledger/cactus-fabric2-all-in-one:2021-09-02--fix-876-supervisord-retries and ghcr.io/hyperledger/cactus-fabric-all-in-one:2021-09-02--fix-876-supervisord-retries Fixes hyperledger-cacti#718 Fixes hyperledger-cacti#876 Fixes hyperledger-cacti#320 Fixes hyperledger-cacti#319 Signed-off-by: Peter Somogyvari <[email protected]>
1 parent 211853d commit 006290a

File tree

12 files changed

+14
-11
lines changed

12 files changed

+14
-11
lines changed

examples/cactus-example-carbon-accounting-backend/src/main/typescript/infrastructure/carbon-accounting-app-dummy-infrastructure.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class CarbonAccountingAppDummyInfrastructure {
127127
this.fabric = new FabricTestLedgerV1({
128128
publishAllPorts: true,
129129
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
130-
imageVersion: "2021-04-20-nodejs",
130+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
131131
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
132132
logLevel: this.options.logLevel || "INFO",
133133
});

examples/cactus-example-supply-chain-backend/src/main/typescript/infrastructure/supply-chain-app-dummy-infrastructure.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class SupplyChainAppDummyInfrastructure {
113113
this.fabric = new FabricTestLedgerV1({
114114
publishAllPorts: true,
115115
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
116-
imageVersion: "2021-03-02-ssh-hotfix",
116+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
117117
logLevel: level,
118118
emitContainerLogs: true,
119119
});

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v1-4-x/deploy-cc-from-golang-source.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test(testCase, async (t: Test) => {
6060
// imageName: "faio14x",
6161
// imageVersion: "latest",
6262
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
63-
imageVersion: "2021-04-21-2016750",
63+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6464
});
6565

6666
const tearDown = async () => {

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v1-4-x/run-transaction-endpoint-v1.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test(testCase, async (t: Test) => {
6262
emitContainerLogs: true,
6363
logLevel,
6464
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
65-
imageVersion: "2020-12-16-3ddfd8f-v1.4.8",
65+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6666
envVars: new Map([
6767
["FABRIC_VERSION", "1.4.8"],
6868
["CA_VERSION", "1.4.9"],

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test(testCase, async (t: Test) => {
5959
emitContainerLogs: true,
6060
publishAllPorts: true,
6161
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
62-
imageVersion: "2021-04-20-nodejs",
62+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6363
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
6464
logLevel,
6565
});

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ test(testCase, async (t: Test) => {
6161
// imageName: "faio2x",
6262
// imageVersion: "latest",
6363
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
64-
imageVersion: "2021-04-20-nodejs",
64+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6565
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
6666
logLevel,
6767
});

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test(testCase, async (t: Test) => {
6262
// imageName: "faio2x",
6363
// imageVersion: "latest",
6464
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
65-
imageVersion: "2021-04-20-nodejs",
65+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6666
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
6767
logLevel,
6868
});

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test(testCase, async (t: Test) => {
6262
// imageName: "faio2x",
6363
// imageVersion: "latest",
6464
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
65-
imageVersion: "2021-04-20-nodejs",
65+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6666
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
6767
logLevel,
6868
});

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-endpoint-v1.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test(testCase, async (t: Test) => {
6565
publishAllPorts: true,
6666
logLevel,
6767
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
68-
imageVersion: "2021-04-20-nodejs",
68+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
6969
envVars: new Map([
7070
["FABRIC_VERSION", "2.2.0"],
7171
["CA_VERSION", "1.4.9"],

packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-with-identities.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test("run-transaction-with-identities", async (t: Test) => {
4242
emitContainerLogs: true,
4343
publishAllPorts: true,
4444
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
45-
imageVersion: "2021-04-20-nodejs",
45+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
4646
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
4747
logLevel,
4848
});

packages/cactus-test-tooling/src/main/typescript/fabric/fabric-test-ledger-v1.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export interface IFabricTestLedgerV1ConstructorOptions {
3737
* Provides default options for Fabric container
3838
*/
3939
const DEFAULT_OPTS = Object.freeze({
40-
imageVersion: "2021-01-05-3400c06",
4140
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
41+
imageVersion: "2021-09-02--fix-876-supervisord-retries",
4242
envVars: new Map([["FABRIC_VERSION", "1.4.8"]]),
4343
});
4444
export const FABRIC_TEST_LEDGER_DEFAULT_OPTIONS = DEFAULT_OPTS;

tools/docker/fabric-all-in-one/supervisord.conf

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ loglevel = debug
88
command=/usr/sbin/sshd -D
99
autostart=true
1010
autorestart=true
11+
startretries=20
1112
stderr_logfile=/dev/stderr
1213
stderr_logfile_maxbytes=0
1314
stdout_logfile=/dev/stdout
@@ -17,6 +18,7 @@ stdout_logfile_maxbytes=0
1718
command=dockerd-entrypoint.sh
1819
autostart=true
1920
autorestart=true
21+
startretries=20
2022
stderr_logfile=/dev/stderr
2123
stderr_logfile_maxbytes=0
2224
stdout_logfile=/dev/stdout
@@ -26,6 +28,7 @@ stdout_logfile_maxbytes=0
2628
command=/run-fabric-network.sh
2729
autostart=true
2830
autorestart=unexpected
31+
startretries=20
2932
stderr_logfile=/dev/stderr
3033
stderr_logfile_maxbytes=0
3134
stdout_logfile=/dev/stdout

0 commit comments

Comments
 (0)