From ea249c0f85413add9bff4bbf5e0bf3a4906db320 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 20 Oct 2025 14:26:42 +0300 Subject: [PATCH 1/6] Update CMakeLists.txt and pub_sub.cxx --- tests/CMakeLists.txt | 2 +- tests/universal/network/pub_sub.cxx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f5e8c1de..9a40d2b6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -42,7 +42,7 @@ foreach(file ${files}) endif() endforeach() -file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/universal/network/*.cxx") +file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/universal/network/pub_*.cxx") foreach(file ${files}) if(ZENOHCXX_ZENOHC) # Exclude advanced pub-sub test if unstable features are disabled diff --git a/tests/universal/network/pub_sub.cxx b/tests/universal/network/pub_sub.cxx index 6e71d86b..e1c0c4e0 100644 --- a/tests/universal/network/pub_sub.cxx +++ b/tests/universal/network/pub_sub.cxx @@ -200,6 +200,7 @@ void put_sub_ring_channel(Talloc& alloc) { template void test_with_alloc() { + init_log_from_env_or("error"); if constexpr (share_alloc) { Talloc alloc; pub_sub(alloc); From baca25a9b81afed11bf97300afcc3137f64653be Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 20 Oct 2025 14:36:03 +0300 Subject: [PATCH 2/6] Update pub_sub.cxx --- tests/universal/network/pub_sub.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/universal/network/pub_sub.cxx b/tests/universal/network/pub_sub.cxx index e1c0c4e0..27985195 100644 --- a/tests/universal/network/pub_sub.cxx +++ b/tests/universal/network/pub_sub.cxx @@ -38,7 +38,7 @@ class SHMAllocator { const auto len = strlen(data); auto alloc_result = provider.alloc_gc_defrag_blocking(len, AllocAlignment({0})); ZShmMut&& buf = std::get(std::move(alloc_result)); - memcpy(buf.data(), data, len + 1); + memcpy(buf.data(), data, len); return Bytes(std::move(buf)); } }; @@ -200,7 +200,6 @@ void put_sub_ring_channel(Talloc& alloc) { template void test_with_alloc() { - init_log_from_env_or("error"); if constexpr (share_alloc) { Talloc alloc; pub_sub(alloc); @@ -235,6 +234,9 @@ void publisher_get_keyexpr() { } int main(int argc, char** argv) { +#ifdef ZENOHCXX_ZENOHC + init_log_from_env_or("error"); +#endif test_with_alloc(); #if defined Z_FEATURE_SHARED_MEMORY && defined Z_FEATURE_UNSTABLE_API test_with_alloc(); From 6e2f44049741ae55f46d35b6596de679d2d32842 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 20 Oct 2025 14:54:32 +0300 Subject: [PATCH 3/6] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abbf8326..373d50be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: if [[ "${{ matrix.os }}" == "macos-latest" ]]; then sudo ctest -C ${{ matrix.build_type }} --output-on-failure else - ctest -C ${{ matrix.build_type }} --output-on-failure + RUST_LOG=trace ctest -V -C ${{ matrix.build_type }} --output-on-failure fi - name: Upload artifact From 5d00dc4e1a414e41d0debf05767ce83c106ca002 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 20 Oct 2025 15:21:22 +0300 Subject: [PATCH 4/6] Update ci.yml --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 373d50be..6db127fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,10 @@ jobs: shell: bash run: | cd build + # On ubuntu we need to modify memlock limit to allow tests to run + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + sudo prlimit --memlock=unlimited --pid=$$ + fi # On macOS, sudo is required to run tests due to LAN access permissions if [[ "${{ matrix.os }}" == "macos-latest" ]]; then sudo ctest -C ${{ matrix.build_type }} --output-on-failure From 9f7cd2f96ee2c4dfe6086d8a301b9f08ce23bfcd Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 20 Oct 2025 15:49:29 +0300 Subject: [PATCH 5/6] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6db127fc..1c21c7fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: if [[ "${{ matrix.os }}" == "macos-latest" ]]; then sudo ctest -C ${{ matrix.build_type }} --output-on-failure else - RUST_LOG=trace ctest -V -C ${{ matrix.build_type }} --output-on-failure + ctest -C ${{ matrix.build_type }} --output-on-failure fi - name: Upload artifact From d341698a1258125650d11eb27bfcd526a37525d1 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 20 Oct 2025 17:41:28 +0300 Subject: [PATCH 6/6] Update CMakeLists.txt and pub_sub.cxx --- tests/CMakeLists.txt | 2 +- tests/universal/network/pub_sub.cxx | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9a40d2b6..f5e8c1de 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -42,7 +42,7 @@ foreach(file ${files}) endif() endforeach() -file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/universal/network/pub_*.cxx") +file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/universal/network/*.cxx") foreach(file ${files}) if(ZENOHCXX_ZENOHC) # Exclude advanced pub-sub test if unstable features are disabled diff --git a/tests/universal/network/pub_sub.cxx b/tests/universal/network/pub_sub.cxx index 27985195..35838fbe 100644 --- a/tests/universal/network/pub_sub.cxx +++ b/tests/universal/network/pub_sub.cxx @@ -234,9 +234,6 @@ void publisher_get_keyexpr() { } int main(int argc, char** argv) { -#ifdef ZENOHCXX_ZENOHC - init_log_from_env_or("error"); -#endif test_with_alloc(); #if defined Z_FEATURE_SHARED_MEMORY && defined Z_FEATURE_UNSTABLE_API test_with_alloc();