mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 09:19:24 +00:00
CI: added test sync with clang's memory sanitizer
This commit is contained in:
parent
5f7ce28682
commit
2d10a6a270
3 changed files with 58 additions and 3 deletions
52
.github/workflows/test-sync.yml
vendored
52
.github/workflows/test-sync.yml
vendored
|
@ -3,7 +3,7 @@ name: Sync test
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync-test-ubuntu:
|
sync-test-ubuntu-tsan:
|
||||||
|
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
@ -46,6 +46,54 @@ jobs:
|
||||||
build/*.log
|
build/*.log
|
||||||
build/data/
|
build/data/
|
||||||
|
|
||||||
|
sync-test-ubuntu-msan:
|
||||||
|
|
||||||
|
timeout-minutes: 30
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev
|
||||||
|
|
||||||
|
- name: Install clang
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod +x llvm.sh
|
||||||
|
sudo ./llvm.sh 17
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Build p2pool
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_MSAN=ON -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
|
||||||
|
make -j$(nproc)
|
||||||
|
|
||||||
|
- name: Run p2pool
|
||||||
|
timeout-minutes: 20
|
||||||
|
run: |
|
||||||
|
cd build
|
||||||
|
mkdir data
|
||||||
|
python ../tests/src/stratum_dummy.py stratum_dummy1.log &
|
||||||
|
python ../tests/src/stratum_dummy.py stratum_dummy2.log &
|
||||||
|
python ../tests/src/stratum_dummy.py stratum_dummy3.log &
|
||||||
|
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1" ./p2pool --host xmrnode.facspro.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --data-api data --local-api --loglevel 6
|
||||||
|
grep 'Synchronization finished successfully' p2pool.log
|
||||||
|
|
||||||
|
- name: Archive p2pool.log
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: p2pool_ubuntu_data
|
||||||
|
path: |
|
||||||
|
build/*.log
|
||||||
|
build/data/
|
||||||
|
|
||||||
sync-test-macos:
|
sync-test-macos:
|
||||||
|
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
@ -86,7 +134,7 @@ jobs:
|
||||||
build/*.log
|
build/*.log
|
||||||
build/data/
|
build/data/
|
||||||
|
|
||||||
sync-test-windows:
|
sync-test-windows-debug-asan:
|
||||||
|
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
|
|
|
@ -9,6 +9,7 @@ option(WITH_UPNP "Include UPnP support. If this is turned off, p2pool will not b
|
||||||
|
|
||||||
option(DEV_TEST_SYNC "[Developer only] Sync test, stop p2pool after sync is complete" OFF)
|
option(DEV_TEST_SYNC "[Developer only] Sync test, stop p2pool after sync is complete" OFF)
|
||||||
option(DEV_WITH_TSAN "[Developer only] Compile with thread sanitizer" OFF)
|
option(DEV_WITH_TSAN "[Developer only] Compile with thread sanitizer" OFF)
|
||||||
|
option(DEV_WITH_MSAN "[Developer only] Compile with memory sanitizer" OFF)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
|
@ -36,6 +37,10 @@ if (DEV_WITH_TSAN)
|
||||||
add_definitions(-DDEV_WITH_TSAN)
|
add_definitions(-DDEV_WITH_TSAN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DEV_WITH_MSAN)
|
||||||
|
add_definitions(-DDEV_WITH_MSAN)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(cmake/flags.cmake)
|
include(cmake/flags.cmake)
|
||||||
|
|
||||||
set(HEADERS
|
set(HEADERS
|
||||||
|
|
|
@ -10,11 +10,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||||
|
|
||||||
if (DEV_WITH_TSAN)
|
if (DEV_WITH_TSAN)
|
||||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
|
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
|
||||||
|
elseif (DEV_WITH_MSAN)
|
||||||
|
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=memory")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wcast-qual -Wlogical-op -Wstrict-overflow=2 -Wundef -Wformat=2 -Wpointer-arith -Werror")
|
set(WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wcast-qual -Wlogical-op -Wstrict-overflow=2 -Wundef -Wformat=2 -Wpointer-arith -Werror")
|
||||||
|
|
||||||
if (DEV_WITH_TSAN)
|
if (DEV_WITH_TSAN OR DEV_WITH_MSAN)
|
||||||
set(OPTIMIZATION_FLAGS "-O2 -g")
|
set(OPTIMIZATION_FLAGS "-O2 -g")
|
||||||
else()
|
else()
|
||||||
set(OPTIMIZATION_FLAGS "-Ofast -s")
|
set(OPTIMIZATION_FLAGS "-Ofast -s")
|
||||||
|
|
Loading…
Reference in a new issue