Skip to content

Commit 193fe52

Browse files
committed
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 <[email protected]>
1 parent d075168 commit 193fe52

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { v4 as uuidv4 } from "uuid";
77
import bodyParser from "body-parser";
88
import express from "express";
99

10-
import { FabricTestLedgerV1 } from "@hyperledger/cactus-test-tooling";
10+
import {
11+
Containers,
12+
FabricTestLedgerV1,
13+
} from "@hyperledger/cactus-test-tooling";
1114
import { PluginRegistry } from "@hyperledger/cactus-core";
1215

1316
import {
@@ -37,6 +40,16 @@ import { DiscoveryOptions } from "fabric-network";
3740
*/
3841

3942
test("runs tx on a Fabric v2.2.0 ledger", async (t: Test) => {
43+
// Always set to true when GitHub Actions is running the workflow.
44+
// You can use this variable to differentiate when tests are being run locally or by GitHub Actions.
45+
// @see https://docs.github.com/en/actions/reference/environment-variables
46+
if (process.env.GITHUB_ACTIONS === "true") {
47+
// Github Actions started to run out of disk space recently so we have this
48+
// hack here to attempt to free up disk space when running inside a VM of
49+
// the CI system.
50+
await Containers.pruneDockerResources();
51+
}
52+
4053
const logLevel: LogLevelDesc = "TRACE";
4154

4255
const ledger = new FabricTestLedgerV1({

0 commit comments

Comments
 (0)