mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-05-01 12:18:05 +08:00
Added custom user inputted timeout
This commit is contained in:
18
packages/cache/__tests__/options.test.ts
vendored
18
packages/cache/__tests__/options.test.ts
vendored
@@ -55,3 +55,21 @@ test('getUploadOptions overrides all settings', async () => {
|
||||
|
||||
expect(actualOptions).toEqual(expectedOptions)
|
||||
})
|
||||
|
||||
test('getDownloadOptions overrides download timeout minutes', async () => {
|
||||
const expectedOptions: DownloadOptions = {
|
||||
useAzureSdk: false,
|
||||
downloadConcurrency: 14,
|
||||
timeoutInMs: 20000,
|
||||
segmentTimeoutInMs: 3600000
|
||||
}
|
||||
process.env.CACHE_DOWNLOAD_TIMEOUT_MINS = '10'
|
||||
const actualOptions = getDownloadOptions(expectedOptions)
|
||||
|
||||
expect(actualOptions.useAzureSdk).toEqual(expectedOptions.useAzureSdk)
|
||||
expect(actualOptions.downloadConcurrency).toEqual(
|
||||
expectedOptions.downloadConcurrency
|
||||
)
|
||||
expect(actualOptions.timeoutInMs).toEqual(expectedOptions.timeoutInMs)
|
||||
expect(actualOptions.segmentTimeoutInMs).toEqual(600000)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user