Ejemplo n.º 1
0
 def test_limit_threads(self):
     ''' Tests that the number of threads used for downloading inputs in parallel is limited '''
     instance_types = InstanceTypesCompleter().instance_types
     max_threads = 8
     for inst in instance_types.values():
         num_threads = _get_num_parallel_threads(max_threads, inst.CPU_Cores, inst.Memory_GB*1024)
         self.assertTrue(num_threads >= 1 and num_threads <= max_threads)
         self.assertTrue(num_threads <= inst.CPU_Cores)
         self.assertTrue(num_threads*1200 <= inst.Memory_GB*1024 or num_threads == 1)
Ejemplo n.º 2
0
 def test_limit_threads(self):
     ''' Tests that the number of threads used for downloading inputs in parallel is limited '''
     instance_types = InstanceTypesCompleter().instance_types
     max_threads = 8
     for inst in instance_types.values():
         num_threads = _get_num_parallel_threads(max_threads,
                                                 inst.CPU_Cores,
                                                 inst.Memory_GB * 1024)
         self.assertTrue(num_threads >= 1 and num_threads <= max_threads)
         self.assertTrue(num_threads <= inst.CPU_Cores)
         self.assertTrue(num_threads * 1200 <= inst.Memory_GB * 1024
                         or num_threads == 1)