From 6a2acc4a206f808335ea28e27761d986273f2a4e Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" <robin.mueller.m@gmail.com> Date: Thu, 23 Apr 2020 00:28:41 +0200 Subject: [PATCH] module tests wait times larger --- ...ule_Test_Serial.xml => tmtcclient_Module_Test_Serial.xml} | 2 +- ...ervice_17_Serial.xml => tmtcclient_Service_17_Serial.xml} | 2 +- ...nt_Software_Serial.xml => tmtcclient_Software_Serial.xml} | 2 +- comIF/obsw_ethernet_com_if.py | 5 +++-- obsw_tmtc_client.py | 2 +- test/obsw_pus_service_test.py | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) rename .idea/runConfigurations/{OBSW_TmTcClient_Module_Test_Serial.xml => tmtcclient_Module_Test_Serial.xml} (86%) rename .idea/runConfigurations/{OBSW_UdpClient_Service_17_Serial.xml => tmtcclient_Service_17_Serial.xml} (86%) rename .idea/runConfigurations/{OBSW_TmTcClient_Software_Serial.xml => tmtcclient_Software_Serial.xml} (86%) diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Module_Test_Serial.xml b/.idea/runConfigurations/tmtcclient_Module_Test_Serial.xml similarity index 86% rename from .idea/runConfigurations/OBSW_TmTcClient_Module_Test_Serial.xml rename to .idea/runConfigurations/tmtcclient_Module_Test_Serial.xml index 9d3a170..edc3069 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Module_Test_Serial.xml +++ b/.idea/runConfigurations/tmtcclient_Module_Test_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_TmTcClient Module Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="tmtcclient Module Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/.idea/runConfigurations/OBSW_UdpClient_Service_17_Serial.xml b/.idea/runConfigurations/tmtcclient_Service_17_Serial.xml similarity index 86% rename from .idea/runConfigurations/OBSW_UdpClient_Service_17_Serial.xml rename to .idea/runConfigurations/tmtcclient_Service_17_Serial.xml index f5a39bf..641828f 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Service_17_Serial.xml +++ b/.idea/runConfigurations/tmtcclient_Service_17_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_UdpClient Service 17 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="tmtcclient Service 17 Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml b/.idea/runConfigurations/tmtcclient_Software_Serial.xml similarity index 86% rename from .idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml rename to .idea/runConfigurations/tmtcclient_Software_Serial.xml index 2088585..58c344f 100644 --- a/.idea/runConfigurations/OBSW_TmTcClient_Software_Serial.xml +++ b/.idea/runConfigurations/tmtcclient_Software_Serial.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="OBSW_TmTcClient Software Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> + <configuration default="false" name="tmtcclient Software Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication"> <module name="tmtc" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> diff --git a/comIF/obsw_ethernet_com_if.py b/comIF/obsw_ethernet_com_if.py index 146e12d..647dc1c 100644 --- a/comIF/obsw_ethernet_com_if.py +++ b/comIF/obsw_ethernet_com_if.py @@ -14,18 +14,19 @@ from comIF.obsw_com_interface import CommunicationInterface, PusTmListT, PusTmQu PusTmTupleQueueT, PusTmInfoQueueT from tm.obsw_pus_tm_factory import pus_telemetry_factory from tc.obsw_pus_tc_base import PusTcInfoT -from utility.obsw_tmtc_printer import TmTcPrinterT +from utility.obsw_tmtc_printer import TmTcPrinter import config.obsw_config as g # pylint: disable=abstract-method # pylint: disable=arguments-differ # pylint: disable=too-many-arguments +# TODO: decouple printing from receiving. Printing takes a long time and blocks! class EthernetComIF(CommunicationInterface): """ Communication interface for UDP communication. """ - def __init__(self, tmtc_printer: TmTcPrinterT, tmTimeout: float, tcTimeoutFactor: float, + def __init__(self, tmtc_printer: TmTcPrinter, tmTimeout: float, tcTimeoutFactor: float, receiveAddress: g.ethernetAddressT, sendAddress: g.ethernetAddressT): super().__init__(tmtc_printer) self.tm_timeout = tmTimeout diff --git a/obsw_tmtc_client.py b/obsw_tmtc_client.py index 7fd1a4a..68f65e4 100644 --- a/obsw_tmtc_client.py +++ b/obsw_tmtc_client.py @@ -182,7 +182,7 @@ def set_communication_interface(tmtc_printer: TmTcPrinterT) -> ComIfT: else: com_port = g.G_COM_PORT baud_rate = 115200 - g.G_SERIAL_TIMEOUT = 0.03 + g.G_SERIAL_TIMEOUT = 0.01 communication_interface = SerialComIF( tmtc_printer=tmtc_printer, com_port=com_port, baud_rate=baud_rate, serial_timeout=g.G_SERIAL_TIMEOUT) diff --git a/test/obsw_pus_service_test.py b/test/obsw_pus_service_test.py index f2abe3b..f918d92 100644 --- a/test/obsw_pus_service_test.py +++ b/test/obsw_pus_service_test.py @@ -25,7 +25,7 @@ class TestService2(TestService): print("Testing Service 2") # all commands must be sent sequentially, not as a burst cls.wait_intervals = [1, 2, 3, 4] - cls.wait_time = [2, 2, 2, 3] + cls.wait_time = [2.5, 2.5, 2.5, 3] pack_service2_test_into(cls.test_queue) def test_service2(self): @@ -104,7 +104,7 @@ class TestService8(TestService): super().setUpClass() print("Testing Service 8") cls.wait_intervals = [1, 2, 3, 4] - cls.wait_time = [1.5, 0.7, 1.0, 1.1] + cls.wait_time = [1.5, 1.5, 1.5, 1.5] cls.data_reply_count = 0 pack_service8_test_into(cls.test_queue) -- GitLab