[ARVADOS] created: 88ce56692e75cebdedc983fcb00aa48ea60aba8b
git at public.curoverse.com
git at public.curoverse.com
Wed Jun 17 16:41:11 EDT 2015
at 88ce56692e75cebdedc983fcb00aa48ea60aba8b (commit)
commit 88ce56692e75cebdedc983fcb00aa48ea60aba8b
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Jun 17 16:40:29 2015 -0400
6277: Simplify manifest-building loop, fix up truncation tests.
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 66b41cb..0eef6b4 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -3,7 +3,6 @@
--
SET statement_timeout = 0;
-SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
diff --git a/services/api/test/unit/collection_test.rb b/services/api/test/unit/collection_test.rb
index 7ce73eb..bcdefe7 100644
--- a/services/api/test/unit/collection_test.rb
+++ b/services/api/test/unit/collection_test.rb
@@ -56,27 +56,27 @@ class CollectionTest < ActiveSupport::TestCase
[
[2**8, false],
[2**18, true],
- ].each do |manifest_size, gets_truncated|
- test "create collection with manifest size #{manifest_size} which gets truncated #{gets_truncated},
+ ].each do |manifest_size, allow_truncate|
+ test "create collection with manifest size #{manifest_size} with allow_truncate=#{allow_truncate},
and not expect exceptions even on very large manifest texts" do
# file_names has a max size, hence there will be no errors even on large manifests
act_as_system_user do
- manifest_text = './blurfl d41d8cd98f00b204e9800998ecf8427e+0'
+ manifest_text = ''
index = 0
while manifest_text.length < manifest_size
- manifest_text += './subdir1 d41d8cd98f00b204e9800998ecf8427e+0' if index > 0
- manifest_text += ' ' + "0:0:veryverylongfilename000000000000#{index}.txt\n"
+ manifest_text += "./blurfl d41d8cd98f00b204e9800998ecf8427e+0 0:0:veryverylongfilename000000000000#{index}.txt\n"
index += 1
end
+ manifest_text += "./laststreamname d41d8cd98f00b204e9800998ecf8427e+0 0:0:veryverylastfilename.txt\n"
c = Collection.create(manifest_text: manifest_text)
assert c.valid?
assert c.file_names
assert_match /veryverylongfilename0000000000001.txt/, c.file_names
assert_match /veryverylongfilename0000000000002.txt/, c.file_names
- if !gets_truncated
- assert_match /blurfl/, c.file_names
- assert_match /subdir1/, c.file_names
+ if not allow_truncate
+ assert_match /veryverylastfilename/, c.file_names
+ assert_match /laststreamname/, c.file_names
end
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list