X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/44f0e83d50f688bf73c336747402d490346f5c34..9b46e402be4366b591ce9c73e2afb24bef0a3dd5:/services/api/test/unit/collection_performance_test.rb diff --git a/services/api/test/unit/collection_performance_test.rb b/services/api/test/unit/collection_performance_test.rb index 1c6e4f2db2..bbae49f4a2 100644 --- a/services/api/test/unit/collection_performance_test.rb +++ b/services/api/test/unit/collection_performance_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' require 'helpers/manifest_examples' require 'helpers/time_block' @@ -8,23 +12,21 @@ class CollectionModelPerformanceTest < ActiveSupport::TestCase setup do # The Collection model needs to have a current token, not just a # current user, to sign & verify manifests: - Thread.current[:api_client_authorization] = - api_client_authorizations(:active) + Thread.current[:token] = api_client_authorizations(:active).token end teardown do - Thread.current[:api_client_authorization] = nil + Thread.current[:token] = nil end # "crrud" == "create read render update delete", not a typo - test "crrud cycle for a collection with a big manifest)" do - slow_test + slow_test "crrud cycle for a collection with a big manifest)" do bigmanifest = time_block 'make example' do make_manifest(streams: 100, files_per_stream: 100, blocks_per_file: 20, bytes_per_block: 2**26, - api_token: api_token(:active)) + api_token: api_client_authorizations(:active).token) end act_as_user users(:active) do c = time_block "new (manifest_text is #{bigmanifest.length>>20}MiB)" do @@ -40,14 +42,11 @@ class CollectionModelPerformanceTest < ActiveSupport::TestCase c = time_block 'read' do Collection.find_by_uuid(c.uuid) end - time_block 'sign' do - c.signed_manifest_text - end - time_block 'sign + render' do - resp = c.as_api_response(nil) + time_block 'render' do + c.as_api_response(nil) end loc = Blob.sign_locator(Digest::MD5.hexdigest('foo') + '+3', - api_token: api_token(:active)) + api_token: api_client_authorizations(:active).token) # Note Collection's strip_manifest_text method has now removed # the signatures from c.manifest_text, so we have to start from # bigmanifest again here instead of just appending with "+=".