Repository navigation
CI: build and test with GitHub Actions + fix two stale csnode tests - #1
Merged
Merged
Conversation
The nodetests target no longer compiled, so none of the csnode unit tests could run. Test-only change: production code is untouched. - conveyer_tests: PoolMetaInfo gained a `reward` field after `timestamp`, so the aggregate initializer was shifted by one. Pass an empty reward; applyCharacteristic adds the reward user field only when it is non-empty, so expectations are unchanged. - poolsynchronizer_tests: PoolSynchronizer::neighbours() was removed in 3ed6b98 (new synchronization algorithm). Neighbours are now a private unordered_map, so the "sorted by sequence" invariant no longer exists. Drop the helper and its assertion from the already DISABLED test, with a comment explaining why. Result with ENABLE_TESTS=ON (GCC 13, Boost 1.83 static): nodetests 110/110, lmdbxxtests 13/13 and lib_system 49/49 pass. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds one workflow that builds the node on Linux and runs the unit tests: - on push to master, i.e. when a PR is merged; - on pull requests to master, so a change is checked before merge; - on demand (workflow_dispatch). Nothing outside .github/ changes. Build recipe (same as the one verified locally): - Ubuntu 24.04, GCC 13, Ninja + ccache, Release, ENABLE_TESTS=ON. - Boost 1.83 is built from the verified source tarball as static libs with a static runtime, because the CMake files set Boost_USE_STATIC_RUNTIME, which distro packages do not provide. It is cached between runs. - Submodules are initialised by explicit path: the orphan third-party/rocksdb gitlink (no .gitmodules entry) makes a plain recursive update fail. - CMAKE_CXX_FLAGS "-include cstdint -include cstddef" works around missing includes that GCC 13 exposes in third-party base58 and csnode/bitheap.hpp, without touching the sources. - Tests run with ctest. The node binary is uploaded as an artifact (30 days). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sage First CI run: every node and test target built (365/366). The one failure was Thrift's Haskell library. The ubuntu-24.04 image ships GHC/cabal, so Thrift turns WITH_HASKELL on by itself. The node does not use it, so pass -DWITH_HASKELL=OFF from the workflow; the project's CMake files are unchanged. Also: - Split actions/cache into restore + save, so the Boost and ccache caches are kept even when a later step fails (the post-step save is skipped on failure). - Add a final "Disk usage" step (always runs) that prints free space and the size of the workspace, the build dir, Boost and ccache. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
In run 37643122295 the build passed, but the Test step was still running after more than 20 minutes. Locally the same three suites finish in about 35 s, also on 2 cores with no stdin. GitHub does not expose the job log until the job ends, so make the hang visible: - ctest --timeout 300 kills a stuck test and --output-on-failure prints what it logged up to that point; - step timeout-minutes: 20 so the runner is not held for the job's 3 hours. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This made the `system` suite hang on the GitHub runner (ctest timeout at 300 s
in run 37647459022). Test-only change: production code is untouched.
- The writer generated a value "different from previous" with
`do { ... } while (randomValue != previous.data())`. The condition is
inverted: on the first pass previous is 0 and values are drawn from
[1, INT_MAX], so the loop never ends. Locally the writer thread usually
started after `isRunning` was already false, which hid the bug; on the runner
it started first and spun forever. Use `==`.
- With the loop fixed, a second race became visible: the reader's
wait_for(250 ms) can time out before the writer stored anything, and then
`desired != previous` compares 0 with 0. Only assert once a value has been
written.
Locally: 3000/3000 repetitions pass, and 1000/1000 with every core busy.
Before the fix it hung within 4 repetitions.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Two separate commits. Production code is not touched.
1.
tests: fix two stale csnode tests so nodetests builds againThe
nodeteststarget no longer compiled, so none of the csnode unit tests could run.tests/csnode/conveyer_tests.cpp:PoolMetaInfogained arewardfield aftertimestamp, so the test's aggregate initializer was shifted by one. Pass an empty reward.applyCharacteristicadds the reward field only when it is non-empty, so the expectations are unchanged.tests/csnode/poolsynchronizer_tests.cpp:PoolSynchronizer::neighbours()was removed in 3ed6b98 (new synchronization algorithm). Neighbours are now a privateunordered_map, so the "sorted by sequence" invariant no longer exists. Remove the helper and its assertion from the alreadyDISABLED_test, with a comment explaining why.2.
ci: build the node and run tests with GitHub ActionsAdds only
.github/workflows/build.yml:master(i.e. PR merge), pull requests tomaster, manual (workflow_dispatch).ENABLE_TESTS=ON.Boost_USE_STATIC_RUNTIMEand distro packages don't provide that. The source tarball is checked with sha256, and the build is cached between runs.third-party/rocksdb(no.gitmodulesentry) makes a recursive update fail.-include cstdint -include cstddefworks around includes that GCC 13 no longer pulls in transitively (third-party base58,csnode/bitheap.hpp), without touching the sources.ctest, and thenodebinary is uploaded as an artifact (30 days).Later commits on this PR disable Thrift's Haskell library on the runner, keep the caches on failure, add a disk-usage report and a per-test timeout, and fix
LockFreeChanger.BaseUsageSimple(an infinite loop in the test).Local verification
nodetests 110/110, lmdbxxtests 13/13, lib_system 49/49.
🤖 Generated with Claude Code