github.com/cozy/cozy-stack@v0.0.0-20240603063001-31110fa4cae1/tests/system/scalability/large_files.rb (about) 1 require_relative './base_tests.rb' 2 3 N_FILES_INIT = 100 4 FILE_MAX_SIZE = 1_000_000 # In KB 5 6 # This test creates a sharing with large files 7 8 # Create the instances 9 inst_names = ["Alice", "Bob"] 10 insts = create_instances inst_names 11 inst_a = insts[0] 12 inst_b = insts[1] 13 14 # Create the folder to share 15 folder = Folder.create inst_a 16 17 # Create files with size between 1 MB and FILE_MAX_SIZE KB 18 N_FILES_INIT.times do 19 size = Random.rand FILE_MAX_SIZE 20 create_file_with_size inst_a, folder.couch_id, size 21 end 22 23 # Create the sharing 24 create_sharing insts, folder 25 26 # Make sure everything went well 27 da = File.join Helpers.current_dir, inst_a.domain, folder.name 28 db = File.join Helpers.current_dir, inst_b.domain, "/#{Helpers::SHARED_WITH_ME}/#{folder.name}" 29 poll_for_diff da, db