diff --git a/tests/functional/constants/ovms_messages.py b/tests/functional/constants/ovms_messages.py index f8c5a7ed6e..742be61e94 100644 --- a/tests/functional/constants/ovms_messages.py +++ b/tests/functional/constants/ovms_messages.py @@ -249,6 +249,7 @@ class OvmsMessages: ERROR_INVALID_LAYOUT_NHWC = "Received binary image input but resource not configured to accept NHWC layout" ERROR_BINARY_INPUTS_CONVERSION_FAILED = "Binary inputs conversion failed." ERROR_BINARY_INPUTS_NATIVE_FILE_FORMAT_CONVERSION = "Input native file format conversion failed" + ERROR_BINARY_INPUTS_DECODED_SIZE_ESTIMATION = "Decoded size could not be estimated for input" ERROR_BINARY_INPUTS_CORRUPT_JPEG_DATA = "Corrupt JPEG data" ERROR_INTERPOLATE_NODE_IS_NOT_SUPPORTED = "Interpolate node is not supported:" diff --git a/tests/functional/object_model/ovms_instance.py b/tests/functional/object_model/ovms_instance.py index f3c1d4b2b2..e3f08beb1d 100644 --- a/tests/functional/object_model/ovms_instance.py +++ b/tests/functional/object_model/ovms_instance.py @@ -399,19 +399,19 @@ def get_signal_type(terminate_signal_type): raise NotImplementedError(f"Unknown signal: {terminate_signal_type}") def filter_unexpected_messages(self, unexpected_messages): - for msg in unexpected_messages: - # 1) This message is expected in OV tests with batch_size=0 - # 2) This message can happen in Cython instances that use threading # CVS-165321 - if all([ - OvmsMessages.ERROR_TERMINATE_CALLED in msg, - self.context is not None and "test_ov_app_cpp_batch_size_0" in self.context.name, - ]) or all([ - OvmsMessages.ERROR_TERMINATE_CALLED in msg, - OvmsMessages.STD_SYSTEM_ERROR in msg, - hasattr(self, "cmd") and self.cmd is not None and "OvmsCapiInstance" in self.cmd.__str__, - ]): - unexpected_messages.remove(msg) - return unexpected_messages + return [msg for msg in unexpected_messages if not self._is_expected_message(msg)] + + def _is_expected_message(self, msg): + # 1) This message is expected in OV tests with batch_size=0 + # 2) This message can happen in Cython instances that use threading # CVS-165321 + return all([ + OvmsMessages.ERROR_TERMINATE_CALLED in msg, + self.context is not None and "test_ov_app_cpp_batch_size_0" in self.context.name, + ]) or all([ + OvmsMessages.ERROR_TERMINATE_CALLED in msg, + OvmsMessages.STD_SYSTEM_ERROR in msg, + getattr(self, "cmd", None) is not None and "OvmsCapiInstance" in str(self.cmd), + ]) def cleanup(self, timeout=30): try: