1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 require 'helpers/manifest_examples'
8 require 'helpers/time_block'
10 class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
11 include ManifestExamples
13 slow_test "crud cycle for a collection with a big manifest" do
14 bigmanifest = time_block 'make example' do
15 make_manifest(streams: 100,
16 files_per_stream: 100,
18 bytes_per_block: 2**26,
19 api_token: api_token(:active))
21 json = time_block "JSON encode #{bigmanifest.length>>20}MiB manifest" do
22 SafeJSON.dump({"manifest_text" => bigmanifest})
24 time_block 'create' do
25 post '/arvados/v1/collections', {collection: json}, auth(:active)
26 assert_response :success
28 uuid = json_response['uuid']
30 get '/arvados/v1/collections/' + uuid, {}, auth(:active)
31 assert_response :success
34 get '/arvados/v1/collections', {select: ['manifest_text'], filters: [['uuid', '=', uuid]].to_json}, auth(:active)
35 assert_response :success
37 time_block 'update' do
38 put '/arvados/v1/collections/' + uuid, {collection: json}, auth(:active)
39 assert_response :success
41 time_block 'delete' do
42 delete '/arvados/v1/collections/' + uuid, {}, auth(:active)
46 slow_test "memory usage" do
47 hugemanifest = make_manifest(streams: 1,
48 files_per_stream: 2000,
50 bytes_per_block: 2**26,
51 api_token: api_token(:active))
52 json = time_block "JSON encode #{hugemanifest.length>>20}MiB manifest" do
53 SafeJSON.dump({manifest_text: hugemanifest})
56 post '/arvados/v1/collections', {collection: json}, auth(:active)