From 1f22f9faf91b62d45b8cbc241deed39faa48c3e0 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Fri, 15 Mar 2024 14:53:33 +0000 Subject: [PATCH] adding debug for mac upload testing --- packages/artifact/package-lock.json | 28 ++++++++++++++++++- packages/artifact/package.json | 3 +- .../src/internal/upload/upload-artifact.ts | 8 ++++++ packages/artifact/src/internal/upload/zip.ts | 1 - 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 4ce3c7fb..4222a676 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -22,7 +22,8 @@ "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1" + "unzip-stream": "^0.3.1", + "why-is-node-running": "^2.2.2" }, "devDependencies": { "@types/archiver": "^5.3.2", @@ -1240,6 +1241,11 @@ "vscode-textmate": "^8.0.0" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==" + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1249,6 +1255,11 @@ "node": ">=0.10.0" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==" + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1471,6 +1482,21 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index c1557081..a246fdc7 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -53,7 +53,8 @@ "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1" + "unzip-stream": "^0.3.1", + "why-is-node-running": "^2.2.2" }, "devDependencies": { "@types/archiver": "^5.3.2", diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index e880102f..a4f1ef6c 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -1,3 +1,4 @@ +import whyIsNodeRunning from 'why-is-node-running' import * as core from '@actions/core' import { UploadArtifactOptions, @@ -107,6 +108,13 @@ export async function uploadArtifact( core.info( `Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}` ) + if (core.isDebug()) { + setTimeout(function () { + core.debug('Processes keeping upload stream running:') + whyIsNodeRunning() + }, 500) + } + // return { size: uploadResult.uploadSize, diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 5a923119..d7a748fe 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -29,7 +29,6 @@ export async function createZipUploadStream( core.debug( `Creating Artifact archive with compressionLevel: ${compressionLevel}` ) - const zip = archiver.create('zip', { highWaterMark: getUploadChunkSize(), zlib: {level: compressionLevel}