github.com/cozy/cozy-stack@v0.0.0-20240603063001-31110fa4cae1/tests/system/scalability/updates.rb (about)

     1  require_relative './base_tests.rb'
     2  
     3  N_FILES_INIT = 1
     4  N_UPDATES = 1000
     5  
     6  # This test produces updates during and after the sharing process
     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 files to share
    15  folder = Folder.create inst_a
    16  files_a = create_files inst_a, N_FILES_INIT, folder.couch_id
    17  
    18  # Create the sharing and generate updates
    19  create_sharing insts, folder
    20  generate_updates [inst_a], N_UPDATES, files_a
    21  
    22  # Make sure everything went well
    23  da = File.join Helpers.current_dir, inst_a.domain, folder.name
    24  path_folder_b = "/#{Helpers::SHARED_WITH_ME}/#{folder.name}"
    25  db = File.join Helpers.current_dir, inst_b.domain, path_folder_b
    26  poll_for_diff da, db
    27  
    28  # Generate updates from both sides
    29  _, files_b = Folder.children inst_b, path_folder_b
    30  
    31  generate_updates insts, N_UPDATES, files_a, files_b
    32  poll_for_diff da, db