mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
[web] set a few more explicit timeouts on fetch requests (#35402)
* [web] set a few more explicit timeouts on fetch requests Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com> Co-authored-by: Brian Gough <brian.gough@overleaf.com> * [web] update test mocks to expect signal --------- Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com> Co-authored-by: Brian Gough <brian.gough@overleaf.com> GitOrigin-RevId: 356b97207f6e9a2628e54ff15b034a8e694a4524
This commit is contained in:
committed by
Copybot
co-authored by
Andrew Rumble
Brian Gough
parent
05423f1a1d
commit
ff72ccf5ba
@@ -484,7 +484,7 @@ describe('HistoryManager', function () {
|
||||
it('should call the project-history service', async function (ctx) {
|
||||
expect(ctx.FetchUtils.fetchNothing).to.have.been.calledWith(
|
||||
`${ctx.projectHistoryUrl}/project/${projectId}`,
|
||||
{ method: 'DELETE' }
|
||||
{ method: 'DELETE', signal: sinon.match.instanceOf(AbortSignal) }
|
||||
)
|
||||
})
|
||||
|
||||
@@ -497,6 +497,7 @@ describe('HistoryManager', function () {
|
||||
user: ctx.v1HistoryUser,
|
||||
password: ctx.v1HistoryPassword,
|
||||
},
|
||||
signal: sinon.match.instanceOf(AbortSignal),
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
@@ -479,14 +479,15 @@ describe('DocumentConversionManager', function () {
|
||||
)
|
||||
})
|
||||
|
||||
it('should GET the file from clsi-nginx with the clsiserverid query param', function (ctx) {
|
||||
it('should GET the file from clsi-nginx with the a timeout and the clsiserverid query param', function (ctx) {
|
||||
const expectedUrl = new URL(ctx.Settings.apis.clsi.downloadHost)
|
||||
expectedUrl.pathname = `/project/${ctx.conversionId}/build/${ctx.buildId}/output/${ctx.file}`
|
||||
expectedUrl.searchParams.set('clsiserverid', ctx.clsiServerId)
|
||||
|
||||
sinon.assert.calledWith(
|
||||
ctx.fetchUtils.fetchStreamWithResponse,
|
||||
sinon.match(url => url.toString() === expectedUrl.toString())
|
||||
sinon.match(url => url.toString() === expectedUrl.toString()),
|
||||
{ signal: sinon.match.instanceOf(AbortSignal) }
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user