Compare commits

..
Author SHA1 Message Date
Sankalp KotewarandGitHub b01e37c3b5 segment 98 mb with logs 2023-03-01 12:02:04 +00:00
3 changed files with 19 additions and 9 deletions
+17 -1
View File
@@ -242,7 +242,7 @@ export async function downloadCacheStorageSDK(
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH)
const maxSegmentSize = Math.min(102760447, buffer.constants.MAX_LENGTH)
const downloadProgress = new DownloadProgress(contentLength)
const fd = fs.openSync(archivePath, 'w')
@@ -275,7 +275,23 @@ export async function downloadCacheStorageSDK(
'Aborting cache download as the download time exceeded the timeout.'
)
} else if (Buffer.isBuffer(result)) {
core.info(
`Segment offset before writing result to the file ${downloadProgress.segmentOffset}`
)
core.info(
`Download progress object before writing result ${JSON.stringify(
downloadProgress
)}`
)
fs.writeFileSync(fd, result)
core.info(
`Segment offset after writing result to the file ${downloadProgress.segmentOffset}`
)
core.info(
`Download progress object after writing result ${JSON.stringify(
downloadProgress
)}`
)
}
}
} finally {
+2 -7
View File
@@ -176,16 +176,11 @@ describe('proxy', () => {
expect(bypass).toBeTruthy()
})
// Do not match wildcard ("*") as per https://github.com/actions/runner/blob/97195bad5870e2ad0915ebfef1616083aacf5818/docs/adrs/0263-proxy-support.md
it('checkBypass returns true if no_proxy is "*"', () => {
process.env['no_proxy'] = '*'
const bypass = pm.checkBypass(new URL('https://anything.whatsoever.com'))
expect(bypass).toBeTruthy()
})
it('checkBypass returns true if no_proxy contains comma separated "*"', () => {
process.env['no_proxy'] = 'domain.com,* , example.com'
const bypass = pm.checkBypass(new URL('https://anything.whatsoever.com'))
expect(bypass).toBeTruthy()
expect(bypass).toBeFalsy()
})
it('HttpClient does basic http get request through proxy', async () => {
-1
View File
@@ -52,7 +52,6 @@ export function checkBypass(reqUrl: URL): boolean {
.map(x => x.trim().toUpperCase())
.filter(x => x)) {
if (
upperNoProxyItem === '*' ||
upperReqHosts.some(
x =>
x === upperNoProxyItem ||