Merge branch '8886-async-permission-update' refs #8886
[arvados.git] / services / api / test / integration / collections_performance_test.rb
index 7b790b7de2cb58f91d1574dd13e63911b8c8518c..a952c202cb7dbadf73fae734ca0141d000ac5cde 100644 (file)
@@ -6,15 +6,16 @@ class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
   include ManifestExamples
 
   test "crud cycle for a collection with a big manifest" do
+    slow_test
     bigmanifest = time_block 'make example' do
       make_manifest(streams: 100,
                     files_per_stream: 100,
-                    blocks_per_file: 10,
+                    blocks_per_file: 20,
                     bytes_per_block: 2**26,
                     api_token: api_token(:active))
     end
     json = time_block "JSON encode #{bigmanifest.length>>20}MiB manifest" do
-      Oj.dump({manifest_text: bigmanifest})
+      Oj.dump({"manifest_text" => bigmanifest})
     end
     time_block 'create' do
       post '/arvados/v1/collections', {collection: json}, auth(:active)
@@ -37,4 +38,19 @@ class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
       delete '/arvados/v1/collections/' + uuid, {}, auth(:active)
     end
   end
+
+  test "memory usage" do
+    slow_test
+    hugemanifest = make_manifest(streams: 1,
+                                 files_per_stream: 2000,
+                                 blocks_per_file: 200,
+                                 bytes_per_block: 2**26,
+                                 api_token: api_token(:active))
+    json = time_block "JSON encode #{hugemanifest.length>>20}MiB manifest" do
+      Oj.dump({manifest_text: hugemanifest})
+    end
+    vmpeak "post" do
+      post '/arvados/v1/collections', {collection: json}, auth(:active)
+    end
+  end
 end