@@ -4,9 +4,8 @@ import * as fs from 'node:fs/promises';
4
4
import * as os from 'node:os' ;
5
5
import * as path from 'node:path' ;
6
6
import { spawn } from 'node:child_process' ;
7
- import { createWriteStream , openSync , writeSync , close } from 'node:fs' ;
7
+ import { createWriteStream , openSync , writeSync , close , readFileSync } from 'node:fs' ;
8
8
import { pipeline } from 'node:stream/promises' ;
9
- import { setTimeout } from 'timers/promises' ;
10
9
import { inspect } from 'node:util' ;
11
10
12
11
import * as core from '@actions/core' ;
@@ -187,7 +186,6 @@ async function tearDownAutoCache() {
187
186
const log = new Tail ( path . join ( daemonDir , 'daemon.log' ) ) ;
188
187
core . debug ( `tailing daemon.log...` ) ;
189
188
log . on ( 'line' , ( line ) => {
190
- core . debug ( `got a log line` ) ;
191
189
core . info ( line ) ;
192
190
} ) ;
193
191
@@ -198,8 +196,6 @@ async function tearDownAutoCache() {
198
196
core . debug ( `back from post` ) ;
199
197
core . debug ( res ) ;
200
198
} finally {
201
- await setTimeout ( 5000 ) ;
202
-
203
199
core . debug ( `unwatching the daemon log` ) ;
204
200
log . unwatch ( ) ;
205
201
}
@@ -211,6 +207,12 @@ async function tearDownAutoCache() {
211
207
if ( e . code !== 'ESRCH' ) {
212
208
throw e ;
213
209
}
210
+ } finally {
211
+ if ( core . isDebug ( ) ) {
212
+ core . info ( "Entire log:" ) ;
213
+ const log = readFileSync ( path . join ( daemonDir , 'daemon.log' ) ) ;
214
+ core . info ( log . toString ( ) ) ;
215
+ }
214
216
}
215
217
}
216
218
0 commit comments