From 10072a51d1d822e145e428ae79a5d0c5f3c2f155 Mon Sep 17 00:00:00 2001 From: Andrew Rowley Date: Mon, 22 Jul 2024 09:43:06 +0100 Subject: [PATCH 1/3] Fix test issue --- .../model_tests/neuron/test_synaptic_manager.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/unittests/model_tests/neuron/test_synaptic_manager.py b/unittests/model_tests/neuron/test_synaptic_manager.py index 7206979488..db45153a35 100644 --- a/unittests/model_tests/neuron/test_synaptic_manager.py +++ b/unittests/model_tests/neuron/test_synaptic_manager.py @@ -24,6 +24,9 @@ from spinn_machine.version.version_strings import VersionStrings from spinnman.transceiver.mockable_transceiver import MockableTransceiver from spinnman.transceiver import Transceiver +from spinnman.processes import MostDirectConnectionSelector +from spinnman.connections.udp_packet_connections import SCAMPConnection +from spinnman.exceptions import SpinnmanTimeoutException from pacman.model.placements import Placement from pacman.operations.routing_info_allocator_algorithms import ( ZonedRoutingInfoAllocator) @@ -61,6 +64,14 @@ import pyNN.spiNNaker as p +class _MockConnection(SCAMPConnection): + def send(self, data): + pass + + def receive_scp_response(self, timeout=1.0): + raise SpinnmanTimeoutException("Test", timeout) + + class _MockTransceiverinOut(MockableTransceiver): @overrides(MockableTransceiver.malloc_sdram) @@ -99,6 +110,10 @@ def read_word( datum, = struct.unpack("MostDirectConnectionSelector: + return MostDirectConnectionSelector([_MockConnection(0, 0)]) + def say_false(self, *args, **kwargs): return False From 8d01d672e8af26a6706ea6b9f7b0c9394ad7d58a Mon Sep 17 00:00:00 2001 From: Andrew Rowley Date: Mon, 22 Jul 2024 09:45:14 +0100 Subject: [PATCH 2/3] Flake8 --- unittests/model_tests/neuron/test_synaptic_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/model_tests/neuron/test_synaptic_manager.py b/unittests/model_tests/neuron/test_synaptic_manager.py index db45153a35..e74a0e9f73 100644 --- a/unittests/model_tests/neuron/test_synaptic_manager.py +++ b/unittests/model_tests/neuron/test_synaptic_manager.py @@ -111,7 +111,7 @@ def read_word( return datum @overrides(Transceiver.get_scamp_connection_selector) - def get_scamp_connection_selector(self)->MostDirectConnectionSelector: + def get_scamp_connection_selector(self) -> MostDirectConnectionSelector: return MostDirectConnectionSelector([_MockConnection(0, 0)]) From 4143622668d598f8797c8fd2292cfc433bc555e1 Mon Sep 17 00:00:00 2001 From: Andrew Rowley Date: Mon, 22 Jul 2024 11:46:17 +0100 Subject: [PATCH 3/3] Changes in reports generated --- .../test_python_debug/check_debug.py | 12 +++++++----- .../test_debug_mode/check_debug.py | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/proxy_integration_tests/test_python_debug/check_debug.py b/proxy_integration_tests/test_python_debug/check_debug.py index 91e6cc7eb2..d8cfd30883 100644 --- a/proxy_integration_tests/test_python_debug/check_debug.py +++ b/proxy_integration_tests/test_python_debug/check_debug.py @@ -81,12 +81,14 @@ def debug(self): ] sim.setup(1.0) - if (get_config_bool("Machine", "enable_advanced_monitor_support") - and not get_config_bool("Java", "use_java")): + if get_config_bool("Machine", "enable_advanced_monitor_support"): # write_data_speed_up_report - reports.append( - DataSpeedUpPacketGatherMachineVertex.OUT_REPORT_NAME) - reports.append(DataSpeedUpPacketGatherMachineVertex.IN_REPORT_NAME) + if not get_config_bool("Java", "use_java"): + reports.append( + DataSpeedUpPacketGatherMachineVertex.OUT_REPORT_NAME) + else: + reports.append( + DataSpeedUpPacketGatherMachineVertex.IN_REPORT_NAME) pop = sim.Population(100, sim.IF_curr_exp, {}, label="pop") pop.record("v") inp = sim.Population(1, sim.SpikeSourceArray( diff --git a/spynnaker_integration_tests/test_debug_mode/check_debug.py b/spynnaker_integration_tests/test_debug_mode/check_debug.py index 6c9ac48798..bbbcac0a7a 100644 --- a/spynnaker_integration_tests/test_debug_mode/check_debug.py +++ b/spynnaker_integration_tests/test_debug_mode/check_debug.py @@ -81,12 +81,14 @@ def debug(self): ] sim.setup(1.0) - if (get_config_bool("Machine", "enable_advanced_monitor_support") - and not get_config_bool("Java", "use_java")): + if get_config_bool("Machine", "enable_advanced_monitor_support"): # write_data_speed_up_report - reports.append( - DataSpeedUpPacketGatherMachineVertex.OUT_REPORT_NAME) - reports.append(DataSpeedUpPacketGatherMachineVertex.IN_REPORT_NAME) + if not get_config_bool("Java", "use_java"): + reports.append( + DataSpeedUpPacketGatherMachineVertex.OUT_REPORT_NAME) + else: + reports.append( + DataSpeedUpPacketGatherMachineVertex.IN_REPORT_NAME) pop = sim.Population(100, sim.IF_curr_exp, {}, label="pop") pop.record("v") inp = sim.Population(1, sim.SpikeSourceArray(