mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 07:23:43 -05:00
[misc] test/acceptance: retrieve ingress metrics just before using it
The upload request can bump the ingress metric. The content hash validation might require a full download in case the ETag field of the upload response is not a md5 sum.
This commit is contained in:
parent
516102e6fb
commit
2b9d0868c5
1 changed files with 10 additions and 5 deletions
|
@ -148,12 +148,8 @@ describe('Filestore', function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeEach(async function() {
|
||||||
// retrieve previous metrics from the app
|
|
||||||
if (Settings.filestore.backend === 's3') {
|
if (Settings.filestore.backend === 's3') {
|
||||||
;[previousEgress, previousIngress] = await Promise.all([
|
previousEgress = await getMetric(filestoreUrl, 's3_egress')
|
||||||
getMetric(filestoreUrl, 's3_egress'),
|
|
||||||
getMetric(filestoreUrl, 's3_ingress')
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
projectId = `acceptance_tests_${Math.random()}`
|
projectId = `acceptance_tests_${Math.random()}`
|
||||||
})
|
})
|
||||||
|
@ -195,6 +191,15 @@ describe('Filestore', function() {
|
||||||
await pipeline(readStream, writeStream, resultStream)
|
await pipeline(readStream, writeStream, resultStream)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
beforeEach(async function retrievePreviousIngressMetrics() {
|
||||||
|
// The upload request can bump the ingress metric.
|
||||||
|
// The content hash validation might require a full download
|
||||||
|
// in case the ETag field of the upload response is not a md5 sum.
|
||||||
|
if (Settings.filestore.backend === 's3') {
|
||||||
|
previousIngress = await getMetric(filestoreUrl, 's3_ingress')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
it('should return 404 for a non-existant id', async function() {
|
it('should return 404 for a non-existant id', async function() {
|
||||||
const options = { uri: fileUrl + '___this_is_clearly_wrong___' }
|
const options = { uri: fileUrl + '___this_is_clearly_wrong___' }
|
||||||
await expect(
|
await expect(
|
||||||
|
|
Loading…
Reference in a new issue