Set default concurrency to 10 and make timeout configurable

This commit is contained in:
Yang Cao committed 2025-01-08 16:19:09 +00:00
1 parent cd337aea99
commit 335ec19f38
2 files changed
+29 -12

No files matched your search

+16
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()
})
})