فهرست منبع

[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.
Jakob Ackermann 6 سال پیش
والد
کامیت
2b9d0868c5
1فایلهای تغییر یافته به همراه10 افزوده شده و 5 حذف شده
  1. 10 5
      services/filestore/test/acceptance/js/FilestoreTests.js

+ 10 - 5
services/filestore/test/acceptance/js/FilestoreTests.js

@@ -148,12 +148,8 @@ describe('Filestore', function() {
       })
 
       beforeEach(async function() {
-        // retrieve previous metrics from the app
         if (Settings.filestore.backend === 's3') {
-          ;[previousEgress, previousIngress] = await Promise.all([
-            getMetric(filestoreUrl, 's3_egress'),
-            getMetric(filestoreUrl, 's3_ingress')
-          ])
+          previousEgress = await getMetric(filestoreUrl, 's3_egress')
         }
         projectId = `acceptance_tests_${Math.random()}`
       })
@@ -195,6 +191,15 @@ describe('Filestore', function() {
           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() {
           const options = { uri: fileUrl + '___this_is_clearly_wrong___' }
           await expect(