diff --git a/.github/workflows/flow-pull-request-checks-on-macos.yaml b/.github/workflows/flow-pull-request-checks-on-macos.yaml index 3fd76caf..db492789 100644 --- a/.github/workflows/flow-pull-request-checks-on-macos.yaml +++ b/.github/workflows/flow-pull-request-checks-on-macos.yaml @@ -48,12 +48,22 @@ jobs: node-version: [20.x] steps: + - name: Harden Runner + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Update Homebrew run: | - echo "::group::Updating Homebrew" brew update --preinstall - echo "::endgroup::" shell: bash + - name: Install Lima env: GH_TOKEN: ${{ github.token }} @@ -70,6 +80,7 @@ jobs: curl -fsSL "https://github.com/lima-vm/lima/releases/download/${LIMA_VERSION}/lima-${LIMA_VERSION:1}-$(uname -s)-$(uname -m).tar.gz" | tar Cxzvm /usr/local echo "::endgroup::" shell: bash + - name: Install Colima env: GH_TOKEN: ${{ github.token }} @@ -89,6 +100,7 @@ jobs: install colima-$(uname)-$(uname -m) /usr/local/bin/colima echo "::endgroup::" shell: bash + - name: Workaround for Python conflicts in GHA Runners env: HOMEBREW_NO_AUTO_UPDATE: "1" @@ -99,6 +111,7 @@ jobs: brew uninstall --ignore-dependencies python@3 || true brew install --overwrite --force python@3 shell: bash + - name: Install QEMU, Docker client, and Docker Compose env: HOMEBREW_NO_AUTO_UPDATE: "1" @@ -112,6 +125,7 @@ jobs: brew install qemu.rb 2>&1 | tee install.log echo "::endgroup::" shell: bash + - name: Configure Docker Compose plugin run: | mkdir -p ~/.docker/cli-plugins @@ -123,11 +137,43 @@ jobs: run: | CPU_COUNT=$(sysctl -n hw.ncpu) MEMORY=$(sysctl hw.memsize | awk '{print $2/1024/1024/1024}') - COLIMA_ARGS="--cpu 3 --memory 11 --arch x86_64 --network-address" + COLIMA_ARGS="--cpu 3 --memory 10 --arch x86_64 --network-address" echo "::group::Starting Colima with args: $COLIMA_ARGS" colima start $COLIMA_ARGS echo "::endgroup::" shell: bash + - name: Install deps + run: | + npm ci + cd test/smoke + npm ci + + - name: Create temp folders + run: | + mkdir -p /Users/runner/work/hedera-local-node/hedera-local-node/hedera-local-node/network-logs/node/logs + mkdir -p /Users/runner/work/hedera-local-node/hedera-local-node/hedera-local-node/network-logs/node/stats + mkdir -p /Users/runner/work/hedera-local-node/hedera-local-node/hedera-local-node/network-logs/node/accountBalances/balance0.0.3 + mkdir -p /Users/runner/work/hedera-local-node/hedera-local-node/hedera-local-node/network-logs/node/recordStreams/record0.0.3/sidecar + chmod -R 777 /Users/runner/work/hedera-local-node/hedera-local-node/hedera-local-node/ + + - name: Pull docker images + run: | + docker compose pull + +# - name: Run the local node +# uses: step-security/retry@2ab886c0de89f68f146c9b43f53e61abc59c46dc # v3.0.1 +# with: +# max_attempts: 3 +# timeout_minutes: 30 +# command: npm run restart -- --workdir /Users/runner/work/hedera-local-node/hedera-local-node/hedera-local-node +# +# - name: Run smoke test +# uses: step-security/retry@2ab886c0de89f68f146c9b43f53e61abc59c46dc # v3.0.1 +# with: +# max_attempts: 5 +# timeout_minutes: 3 +# command: npm run test:smoke + - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 \ No newline at end of file + uses: mxschmitt/action-tmate@v3 diff --git a/src/services/ConnectionService.ts b/src/services/ConnectionService.ts index fac7ea64..d3c88c64 100644 --- a/src/services/ConnectionService.ts +++ b/src/services/ConnectionService.ts @@ -85,7 +85,7 @@ export class ConnectionService implements IService{ const { host } = this.cliService.getCurrentArgv(); let isReady = false; // this means that we wait around 100 seconds, normal consensus node startup takes around 60 seconds - let retries = 100; + let retries = parseInt(process.env.FIRING_UP_RETRY_ATTEMPTS ?? '20'); while (!isReady) { net .createConnection(port, host) @@ -102,7 +102,7 @@ export class ConnectionService implements IService{ }); retries--; - await new Promise((r) => setTimeout(r, 100)); + await new Promise((r) => setTimeout(r, 500)); if (retries < 0) { throw Errors.CONNECTION_ERROR(port); }