Merge branch '8784-dir-listings'
[arvados.git] / services / api / test / integration / collections_performance_test.rb
index a952c202cb7dbadf73fae734ca0141d000ac5cde..3d13d144b8d658a3133632bb187113e80ae1b733 100644 (file)
@@ -1,3 +1,8 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+require 'safe_json'
 require 'test_helper'
 require 'helpers/manifest_examples'
 require 'helpers/time_block'
@@ -5,8 +10,7 @@ require 'helpers/time_block'
 class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
   include ManifestExamples
 
-  test "crud cycle for a collection with a big manifest" do
-    slow_test
+  slow_test "crud cycle for a collection with a big manifest" do
     bigmanifest = time_block 'make example' do
       make_manifest(streams: 100,
                     files_per_stream: 100,
@@ -15,7 +19,7 @@ class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
                     api_token: api_token(:active))
     end
     json = time_block "JSON encode #{bigmanifest.length>>20}MiB manifest" do
-      Oj.dump({"manifest_text" => bigmanifest})
+      SafeJSON.dump({"manifest_text" => bigmanifest})
     end
     time_block 'create' do
       post '/arvados/v1/collections', {collection: json}, auth(:active)
@@ -39,15 +43,14 @@ class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
     end
   end
 
-  test "memory usage" do
-    slow_test
+  slow_test "memory usage" do
     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})
+      SafeJSON.dump({manifest_text: hugemanifest})
     end
     vmpeak "post" do
       post '/arvados/v1/collections', {collection: json}, auth(:active)