Set default concurrency to 10 and make timeout configurable

This commit is contained in:
Yang Cao
2025-01-08 16:19:09 +00:00
parent adb9c4a7f4
commit f3c12d5561
2 changed files with 29 additions and 12 deletions

View File

@@ -30,3 +30,19 @@ describe('isGhes', () => {
expect(config.isGhes()).toBe(true)
})
})
describe('uploadChunkTimeoutEnv', () => {
it('should return default 300000 when no env set', () => {
expect(config.getUploadChunkTimeout()).toBe(300000)
})
it('should return value set in ACTIONS_UPLOAD_TIMEOUT_MS', () => {
process.env.ACTIONS_UPLOAD_TIMEOUT_MS = '150000'
expect(config.getUploadChunkTimeout()).toBe(150000)
})
it('should throw if value set in ACTIONS_UPLOAD_TIMEOUT_MS is invalid', () => {
process.env.ACTIONS_UPLOAD_TIMEOUT_MS = 'abc'
expect(() => {
config.getUploadChunkTimeout()
}).toThrow()
})
})