Skip to content

Commit

Permalink
hotfix test
Browse files Browse the repository at this point in the history
  • Loading branch information
anuar2k committed Oct 31, 2024
1 parent 98566ae commit 7222199
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/anjay-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,13 @@ jobs:
with:
submodules: recursive
- run: brew update
# NOTE: latest known compatible versions are [email protected] 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
Expand Down
10 changes: 8 additions & 2 deletions tests/integration/framework/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7222199

Please sign in to comment.