Mercurial > hg > orthanc-tests
comparison NewTests/Concurrency/test_concurrency.py @ 596:b1e1c7149a37
new PG upgrades tests
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 21 Dec 2023 18:02:49 +0100 |
parents | 27be80b4b1a9 |
children | 0cbefe7369ee |
comparison
equal
deleted
inserted
replaced
595:b6c1f0c9ca15 | 596:b1e1c7149a37 |
---|---|
236 def test_upload_delete_same_study_from_multiple_threads(self): | 236 def test_upload_delete_same_study_from_multiple_threads(self): |
237 self.o.delete_all_content() | 237 self.o.delete_all_content() |
238 self.clear_storage(storage_name=self._storage_name) | 238 self.clear_storage(storage_name=self._storage_name) |
239 | 239 |
240 start_time = time.time() | 240 start_time = time.time() |
241 overall_repeat = 10 | |
241 | 242 |
242 for i in range(0, 10): | 243 for i in range(0, 10): |
243 workers_count = 5 | 244 workers_count = 5 |
244 repeat_count = 30 | 245 repeat_count = 3 |
245 | 246 |
246 # massively upload and delete the same study. Each worker is writing a part of the instances and deleting them. | 247 # massively upload and delete the same study. Each worker is writing a part of the instances and deleting them. |
247 # We are trying to have multiple workers deleting the last instance of a study at the same time. | 248 # We are trying to have multiple workers deleting the last instance of a study at the same time. |
248 self.execute_workers( | 249 self.execute_workers( |
249 worker_func=worker_upload_delete_study_part, | 250 worker_func=worker_upload_delete_study_part, |
261 self.assertEqual(0, stats.get("CountInstances")) | 262 self.assertEqual(0, stats.get("CountInstances")) |
262 self.assertEqual(0, int(stats.get("TotalDiskSize"))) | 263 self.assertEqual(0, int(stats.get("TotalDiskSize"))) |
263 self.assertTrue(self.is_storage_empty(self._storage_name)) | 264 self.assertTrue(self.is_storage_empty(self._storage_name)) |
264 | 265 |
265 elapsed = time.time() - start_time | 266 elapsed = time.time() - start_time |
266 print(f"TIMING test_upload_delete_same_study_from_multiple_threads with {workers_count} workers and {repeat_count}x repeat: {elapsed:.3f} s") | 267 print(f"TIMING test_upload_delete_same_study_from_multiple_threads with {workers_count} workers and {repeat_count}x repeat ({overall_repeat}x): {elapsed:.3f} s") |
267 | 268 |
268 | 269 |
269 # transfers + dicomweb | 270 # transfers + dicomweb |