Skip to content
Snippets Groups Projects
Commit 0f8d7668 authored by Jan David Mol's avatar Jan David Mol
Browse files

mock right lock

parent 6ae87deb
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ import numpy ...@@ -12,7 +12,8 @@ import numpy
import numpy.testing import numpy.testing
import threading import threading
from tangostationcontrol.beam.delays import Delays, threading as delays_threading from tangostationcontrol.beam import delays
from tangostationcontrol.beam.delays import Delays
from tangostationcontrol.common.constants import MAX_ANTENNA, N_beamlets_ctrl from tangostationcontrol.common.constants import MAX_ANTENNA, N_beamlets_ctrl
from test import base from test import base
...@@ -252,13 +253,14 @@ class TestDelaysBulk(base.TestCase): ...@@ -252,13 +253,14 @@ class TestDelaysBulk(base.TestCase):
# most about the worst case for a thread. We assume the worst # most about the worst case for a thread. We assume the worst
# case thread is slowed down by all the work of the other threads. # case thread is slowed down by all the work of the other threads.
self.assertLess( self.assertLess(
max(duration_results_ms) / nr_threads, single_thread_execution_time * 1.25 max(duration_results_ms) / nr_threads,
single_thread_execution_time * 1.50, # 50% tolerance
) )
# report the performance if we remove the compute lock around casacore, to detect # report the performance if we remove the compute lock around casacore, to detect
# on which systems it matters. # on which systems it matters.
with mock.patch.object(delays_threading, "Lock") as m_lock: with mock.patch.object(delays, "compute_lock") as m_lock:
# compare against multi-threaded performance # compare against multi-threaded performance
duration_results_ms = [] duration_results_ms = []
threads = [ threads = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment