From 193fe52fe2a5bc317dac7d50163cb00eb57fd628 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Tue, 9 Mar 2021 15:09:14 -0800 Subject: [PATCH] fix(ci): github action runner disk full error #641 Added a docker resource pruning call to the test case that was triggering the disk full issue while pulling the Fabric AIO image necessary for it's operation. It is expected that this error will crop up in the future with different test cases and if and when that happens we can add more of the same to those tests as well, but for now, I did not want to make this change to every single test case since it wasn't strictly necessary and a better solution may come along in the near future as well. Fixes #641 Signed-off-by: Peter Somogyvari --- .../run-transaction-endpoint-v1.test.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-endpoint-v1.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-endpoint-v1.test.ts index 7154f0006d..cec33625e4 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-endpoint-v1.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-endpoint-v1.test.ts @@ -7,7 +7,10 @@ import { v4 as uuidv4 } from "uuid"; import bodyParser from "body-parser"; import express from "express"; -import { FabricTestLedgerV1 } from "@hyperledger/cactus-test-tooling"; +import { + Containers, + FabricTestLedgerV1, +} from "@hyperledger/cactus-test-tooling"; import { PluginRegistry } from "@hyperledger/cactus-core"; import { @@ -37,6 +40,16 @@ import { DiscoveryOptions } from "fabric-network"; */ test("runs tx on a Fabric v2.2.0 ledger", async (t: Test) => { + // Always set to true when GitHub Actions is running the workflow. + // You can use this variable to differentiate when tests are being run locally or by GitHub Actions. + // @see https://docs.github.com/en/actions/reference/environment-variables + if (process.env.GITHUB_ACTIONS === "true") { + // Github Actions started to run out of disk space recently so we have this + // hack here to attempt to free up disk space when running inside a VM of + // the CI system. + await Containers.pruneDockerResources(); + } + const logLevel: LogLevelDesc = "TRACE"; const ledger = new FabricTestLedgerV1({