From 72221996afd11e6eadeb7ac4476d522e920e8aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20W=C3=B3jtowicz?= Date: Thu, 31 Oct 2024 13:44:30 +0100 Subject: [PATCH] hotfix test --- .github/workflows/anjay-tests.yml | 8 ++++++-- tests/integration/framework/test_suite.py | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/anjay-tests.yml b/.github/workflows/anjay-tests.yml index d9ebbb9c..52b97ad0 100644 --- a/.github/workflows/anjay-tests.yml +++ b/.github/workflows/anjay-tests.yml @@ -149,9 +149,13 @@ jobs: with: submodules: recursive - run: brew update - # NOTE: latest known compatible versions are openssl@3--3.1.1 and mbedtls--3.4.0 # NOTE: try the brew install command twice to work around "brew link" errors - - run: INSTALL_CMD="brew install openssl mbedtls $COMPILER_VERSION"; $INSTALL_CMD || $INSTALL_CMD + - run: INSTALL_CMD="brew install openssl $COMPILER_VERSION"; $INSTALL_CMD || $INSTALL_CMD + # NOTE: Some tests don't pass on mbedTLS 3.6.2 now, so we need to install an older version + # Homebrew only specifiers major version of mbedTLS, so let's pin the version to 3.6.0 manually + - run: curl https://raw.githubusercontent.com/Homebrew/homebrew-core/219dabf6cab172fb8b62b4d8598e016e190c3c20/Formula/m/mbedtls.rbĀ  > /tmp/mbedtls.rb + - run: brew install --formula /tmp/mbedtls.rb + - run: brew pin mbedtls # NOTE: The above command may have installed a new version of Python, that's why we launch it weirdly - run: /usr/bin/env python3 -m pip install -r requirements.txt - run: env JAVA_HOME="$JAVA_HOME_17_X64" ./devconfig --with-asan --without-analysis --no-examples -DWITH_VALGRIND_TRACK_ORIGINS=OFF -DWITH_URL_CHECK=OFF -DWITH_IPV6=OFF diff --git a/tests/integration/framework/test_suite.py b/tests/integration/framework/test_suite.py index 9470bab2..f7480824 100644 --- a/tests/integration/framework/test_suite.py +++ b/tests/integration/framework/test_suite.py @@ -844,8 +844,14 @@ def communicate(self, cmd, timeout=-1, match_regex=re.escape('(DEMO)>')): timeout = self.DEFAULT_COMM_TIMEOUT self.seek_demo_log_to_end() - self.demo_process.stdin.write((cmd.strip('\n') + '\n').encode()) - self.demo_process.stdin.flush() + # For some reason, writing to a closed pipe seems to behave a little + # differently for macOS and Linux. On macOS, Python receives a SIGPIPE + # and therefore throws a BrokenPipeError. Let's silence it. + try: + self.demo_process.stdin.write((cmd.strip('\n') + '\n').encode()) + self.demo_process.stdin.flush() + except BrokenPipeError: + pass if match_regex: result = self.read_log_until_match(match_regex.encode(), timeout_s=timeout)