Skip to content

Commit 2547171

Browse files
committed
add additional logging in error message to help determine why it fails
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 11571f3 commit 2547171

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/k8.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ export class K8 {
574574
const command = ['cat', `${srcDir}/${srcFile}`]
575575
const writerStream = fs.createWriteStream(tmpFile)
576576
const errStream = new sb.WritableStreamBuffer()
577+
let additionalErrorMessageDetail = ''
577578

578579
execInstance.exec(
579580
namespace,
@@ -605,12 +606,18 @@ export class K8 {
605606
const stat = fs.statSync(destPath)
606607
if (stat && stat.size === srcFileSize) {
607608
return resolve(true)
609+
} else {
610+
if (!stat) {
611+
additionalErrorMessageDetail = ', statSync returned no file status for the destination file'
612+
} else {
613+
additionalErrorMessageDetail = `, stat.size=${stat.size} != srcFileSize=${srcFileSize}`
614+
}
608615
}
609616
} catch (e) {
610617
return reject(new FullstackTestingError(`failed to copy file: ${destPath}`, e))
611618
}
612619

613-
return reject(new FullstackTestingError(`failed to download file completely: ${destPath}`))
620+
return reject(new FullstackTestingError(`failed to download file completely: ${destPath}${additionalErrorMessageDetail}`))
614621
})
615622

616623
conn.on('error', (e) => {

0 commit comments

Comments
 (0)