Skip to content

Commit

Permalink
fix(test): flaky fabric AIO container boot hyperledger#876
Browse files Browse the repository at this point in the history
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#718
Fixes hyperledger#876
Fixes hyperledger#320
Fixes hyperledger#319

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Sep 3, 2021
1 parent 2161e0d commit 23e69bf
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class CarbonAccountingAppDummyInfrastructure {
this.fabric = new FabricTestLedgerV1({
publishAllPorts: true,
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel: this.options.logLevel || "INFO",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class SupplyChainAppDummyInfrastructure {
this.fabric = new FabricTestLedgerV1({
publishAllPorts: true,
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
imageVersion: "2021-03-02-ssh-hotfix",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
logLevel: level,
emitContainerLogs: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test(testCase, async (t: Test) => {
// imageName: "faio14x",
// imageVersion: "latest",
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
imageVersion: "2021-04-21-2016750",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
});

const tearDown = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test(testCase, async (t: Test) => {
emitContainerLogs: true,
logLevel,
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
imageVersion: "2020-12-16-3ddfd8f-v1.4.8",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([
["FABRIC_VERSION", "1.4.8"],
["CA_VERSION", "1.4.9"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test(testCase, async (t: Test) => {
emitContainerLogs: true,
publishAllPorts: true,
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test(testCase, async (t: Test) => {
// imageName: "faio2x",
// imageVersion: "latest",
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test(testCase, async (t: Test) => {
// imageName: "faio2x",
// imageVersion: "latest",
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test(testCase, async (t: Test) => {
// imageName: "faio2x",
// imageVersion: "latest",
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test(testCase, async (t: Test) => {
publishAllPorts: true,
logLevel,
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([
["FABRIC_VERSION", "2.2.0"],
["CA_VERSION", "1.4.9"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test("run-transaction-with-identities", async (t: Test) => {
emitContainerLogs: true,
publishAllPorts: true,
imageName: "ghcr.io/hyperledger/cactus-fabric2-all-in-one",
imageVersion: "2021-04-20-nodejs",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "2.2.0"]]),
logLevel,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export interface IFabricTestLedgerV1ConstructorOptions {
* Provides default options for Fabric container
*/
const DEFAULT_OPTS = Object.freeze({
imageVersion: "2021-01-05-3400c06",
imageName: "ghcr.io/hyperledger/cactus-fabric-all-in-one",
imageVersion: "2021-09-02--fix-876-supervisord-retries",
envVars: new Map([["FABRIC_VERSION", "1.4.8"]]),
});
export const FABRIC_TEST_LEDGER_DEFAULT_OPTIONS = DEFAULT_OPTS;
Expand Down
3 changes: 3 additions & 0 deletions tools/docker/fabric-all-in-one/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ loglevel = debug
command=/usr/sbin/sshd -D
autostart=true
autorestart=true
startretries=20
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stdout_logfile=/dev/stdout
Expand All @@ -17,6 +18,7 @@ stdout_logfile_maxbytes=0
command=dockerd-entrypoint.sh
autostart=true
autorestart=true
startretries=20
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stdout_logfile=/dev/stdout
Expand All @@ -26,6 +28,7 @@ stdout_logfile_maxbytes=0
command=/run-fabric-network.sh
autostart=true
autorestart=unexpected
startretries=20
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stdout_logfile=/dev/stdout
Expand Down

0 comments on commit 23e69bf

Please sign in to comment.