James Dorfman
31df518140
Merge 7b3343f300 into merged_master (Bitcoin PR bitcoin/bitcoin#25108 )
2024-08-13 04:20:55 +00:00
James Dorfman
15be649a16
Merge 5c93fc188d into merged_master (Bitcoin PR bitcoin/bitcoin#25017 )
2024-08-08 20:07:18 +00:00
James Dorfman
3ef748701c
Merge c1059c9fef into merged_master (Bitcoin PR bitcoin/bitcoin#24770 )
2024-07-30 02:08:55 +00:00
Byron Hambly
47626b5a64
Merge 623745ca74 into merged_master (Bitcoin PR bitcoin/bitcoin#23912 )
2023-06-14 15:44:11 +00:00
James Dorfman
8060516e6b
Merge 3c4729a515 into merged_master (Bitcoin PR bitcoin/bitcoin#23223 )
2023-05-17 00:23:54 +00:00
fanquake
7aa40f5563
refactor: use C++11 default initializers
2022-05-17 17:18:58 +01:00
Jon Atack
e5485e8e4b
test, bench: make prevector and checkqueue swap member functions noexcept
...
Reason:
A swap must not fail; when a class has a swap member function, it should be declared noexcept.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c84-a-swap-function-must-not-fail
2022-04-28 20:34:43 +02:00
Jon Atack
39a34b6877
Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive
2022-04-05 12:49:48 +02:00
Hennadii Stepanov
f47dda2c58
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
Commits of previous years:
* 2020: fa0074e2d8
* 2019: aaaaad6ac9
2021-12-30 19:36:57 +02:00
Jon Atack
6ae9f1cf96
Disable lock contention logging in checkqueue_tests
...
as some of these tests are designed to be heavily contested to trigger race
conditions or other issues. This created very large log files when run with
DEBUG_LOCKCONTENTION defined (up to v22) or with lock logging enabled by default
in current master.
Examples running the following command:
./src/test/test_bitcoin -t checkqueue_tests/test_CheckQueue_Correct_Random -- DEBUG_LOG_OUT > testlog.txt
-rw-r--r-- 87042178 Oct 8 12:41 testlog-with-DEBUG_LOCKCONTENTION-at-v22-run1.txt
-rw-r--r-- 73879896 Oct 8 12:42 testlog-with-DEBUG_LOCKCONTENTION-at-v22-run2.txt
-rw-r--r-- 65150518 Oct 8 12:51 testlog-with-DEBUG_LOCKCONTENTION-at-bb9f76a-run1.txt
-rw-r--r-- 65774554 Oct 8 12:52 testlog-with-DEBUG_LOCKCONTENTION-at-bb9f76a-run2.txt
-rw-r--r-- 73493309 Oct 8 13:00 testlog-current-master-at-991753e-run1.txt
-rw-r--r-- 65616977 Oct 8 13:01 testlog-current-master-at-991753e-run2.txt
-rw-r--r-- 5093 Oct 8 13:04 testlog-with-this-commit-run1.txt
-rw-r--r-- 5093 Oct 8 13:05 testlog-with-this-commit-run2.txt
2021-10-08 13:19:19 +02:00
Andrew Poelstra
8c54b98b25
Merge e0bc27a14c into merged_master (Bitcoin PR #21404 )
2021-06-26 22:39:09 +00:00
Andrew Poelstra
bc289db9e0
Merge d0d256536c into merged_master (Bitcoin PR #21016 )
...
Copied the node.scheduler syntax to node.reverification_scheduler
2021-06-20 15:17:57 +00:00
Andrew Poelstra
a7f2499713
Merge b386d37360 into merged_master (Bitcoin PR #18710 )
2021-06-18 19:12:18 +00:00
Andrew Poelstra
e5cb4cb00e
Merge f13e03cda2 into merged_master (Bitcoin PR #20584 )
2021-06-16 20:58:56 +00:00
Andrew Poelstra
1670bdfa0b
ci: fix benchmarks, fuzztests and unit tests
...
Includes a memory leak in the checkqueue unit test (but not in
the actual code). WE really need to switch our checkqueue to use
std::unique_pointer rather than bare pointers. But this would be
invasive enough that I want to do it in a followup PR.
Also pretty-much disable the validation_flush_cache unit test.
This is a stupid and irritating test which tries to unit-test
exact memory usage of std containers. It already has at least
one "remove wrong assumptions" update upstream and after many
tries I was unable to change all the magic numbers in a way
that'd consistently pass CI for Elements.
Also adds a couple ubsan suppressions about perfectly-legitimate
conversions of integer types.
2021-03-26 17:33:05 +00:00
fanquake
3ba2840e7e
scripted-diff: remove MakeUnique<T>()
...
-BEGIN VERIFY SCRIPT-
git rm src/util/memory.h
sed -i -e 's/MakeUnique/std::make_unique/g' $(git grep -l MakeUnique src)
sed -i -e '/#include <util\/memory.h>/d' $(git grep -l '#include <util/memory.h>' src)
sed -i -e '/util\/memory.h \\/d' src/Makefile.am
-END VERIFY SCRIPT-
2021-03-11 13:45:14 +08:00
fanquake
dc8be12510
refactor: remove boost::thread_group usage
2021-01-29 15:39:44 +08:00
Wladimir J. van der Laan
b386d37360
Merge #18710 : Add local thread pool to CCheckQueue
...
bb6fcc75d1 refactor: Drop boost::thread stuff in CCheckQueue (Hennadii Stepanov)
6784ac471b bench: Use CCheckQueue local thread pool (Hennadii Stepanov)
dba30695fc test: Use CCheckQueue local thread pool (Hennadii Stepanov)
01511776ac Add local thread pool to CCheckQueue (Hennadii Stepanov)
0ef938685b refactor: Use member initializers in CCheckQueue (Hennadii Stepanov)
Pull request description:
This PR:
- gets rid of `boost::thread_group` in the `CCheckQueue` class
- allows thread safety annotation usage in the `CCheckQueue` class
- is alternative to #14464 (https://github.com/bitcoin/bitcoin/pull/18710#issuecomment-616618525 , https://github.com/bitcoin/bitcoin/pull/18710#issuecomment-617291612 )
Also, with this PR (I hope) it could be easier to resurrect a bunch of brilliant ideas from #9938 .
Related: #17307
ACKs for top commit:
laanwj:
Code review ACK bb6fcc75d1
LarryRuane:
ACK bb6fcc75d1
jonatack:
Code review ACK bb6fcc75d1 and verified rebase to master builds cleanly with unit/functional tests green
Tree-SHA512: fddeb720d5a391b48bb4c6fa58ed34ccc3f57862fdb8e641745c021841c8340e35c5126338271446cbd98f40bd5484f27926aa6c3e76fa478ba1efafe72e73c1
2021-01-25 20:21:19 +01:00
practicalswift
1c65c075ee
Don't declare de facto const member functions as non-const
2020-12-06 18:44:25 +00:00
Andrew Poelstra
195eb8a243
Merge 4ede05d421 into merged_master (Bitcoin PR #18758 )
2020-11-26 01:08:58 +00:00
Andrew Poelstra
5b9754580e
Merge 55b4c65bd1 into merged_master (Bitcoin PR #16127 )
2020-11-26 01:08:51 +00:00
Andrew Poelstra
fd37b7c5d6
Merge 54f812d9d2 into merged_master (Bitcoin PR #18673 )
2020-11-26 01:08:23 +00:00
Andrew Poelstra
cc668250eb
Merge 97aadf98d0 into merged_master (Bitcoin PR #16117 )
2020-11-26 01:07:50 +00:00
Andrew Poelstra
f5606e5e2b
Merge 35eda631ed into merged_master (Bitcoin PR #17634 )
2020-11-14 16:51:51 +00:00
Andrew Poelstra
3f2190d870
Merge 7d14e35f3f into merged_master (Bitcoin PR #17342 )
2020-11-09 23:10:08 +00:00
Andrew Poelstra
056b9bb06d
Merge 46fc4d1a24 into merged_master (Bitcoin PR #17384 )
2020-11-09 23:10:08 +00:00
Andrew Poelstra
9274da2dfc
Merge 7400135b79 into merged_master (Bitcoin PR #16278 )
2020-11-09 03:58:17 +00:00
Andrew Poelstra
e6343c7258
Merge 0c9de67f34 into merged_master (Bitcoin PR #15352 )
2020-10-28 16:43:51 +00:00
Andrew Poelstra
161bcd2ae8
Merge 78295e97b8 into merged_master (Bitcoin PR #15788 )
2020-10-28 16:43:03 +00:00
Hennadii Stepanov
bb6fcc75d1
refactor: Drop boost::thread stuff in CCheckQueue
2020-09-24 06:55:34 +03:00
Hennadii Stepanov
dba30695fc
test: Use CCheckQueue local thread pool
2020-09-24 06:55:33 +03:00
Hennadii Stepanov
89f9fef1f7
refactor: Specify boost/thread/thread.hpp explicitly
2020-06-04 10:05:54 -04:00
Anthony Towns
a788789948
test/checkqueue_tests: thread safety annotations
2020-05-19 16:33:10 +10:00
MarcoFalke
fa4632c417
test: Move boost/stdlib includes last
2020-04-17 06:36:04 -04:00
MarcoFalke
fa488f131f
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
MarcoFalke
fac5c37300
scripted-diff: Sort test includes
...
-BEGIN VERIFY SCRIPT-
# Mark all lines with #includes
sed -i --regexp-extended -e 's/(#include <.*>)/\1 /g' $(git grep -l '#include' ./src/bench/ ./src/test ./src/wallet/test/)
# Sort all marked lines
git diff -U0 | ./contrib/devtools/clang-format-diff.py -p1 -i -v
-END VERIFY SCRIPT-
2020-04-16 13:32:36 -04:00
MarcoFalke
fa9af06d91
scripted-diff: Replace MilliSleep with UninterruptibleSleep
...
This is safe because MilliSleep is never executed in a boost::thread,
the only type of thread that is interruptible.
* The RPC server uses std::thread
* The wallet is either executed in an RPC thread or the main thread
* bitcoin-cli, benchmarks and tests are only one thread (the main thread)
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/MilliSleep\((\S+)\);/UninterruptibleSleep(std::chrono::milliseconds{\1});/g' $(git grep -l MilliSleep)
-END VERIFY SCRIPT-
2020-02-21 10:06:21 -08:00
Hennadii Stepanov
98fbd1cdff
Use correct C++11 header for std::swap()
2019-11-29 21:23:25 +02:00
MarcoFalke
7d14e35f3f
Merge #17342 : refactor: Clean up nScriptCheckThreads
...
5506ecfe7a [refactor] Replace global int nScriptCheckThreads with bool (John Newbery)
d9957623b4 [tests] Don't use TestingSetup in the checkqueue_tests (John Newbery)
Pull request description:
The meaning of this value is confusing. Refactor it and add comments.
ACKs for top commit:
sipa:
ACK 5506ecfe7a
promag:
ACK 5506ecfe7a , only change was addressing my nits.
laanwj:
Code review ACK 5506ecfe7a
MarcoFalke:
ACK 5506ecfe7a 🥐
Tree-SHA512: 78536727c98d2c23f3c0f3f169131474fef9a4486ae65029011caf06eab30f6f70ff73a65b2fb04a5d969fc1150858d1c6ea4767f04d48c1eea6b829316d0e63
2019-11-07 10:07:11 -05:00
John Newbery
d9957623b4
[tests] Don't use TestingSetup in the checkqueue_tests
...
It's only needed for a hardcoded int, which we can define locally.
2019-11-06 15:03:59 -05:00
MarcoFalke
faec28252c
scripted-diff: test: Move setup_common to test library
...
-BEGIN VERIFY SCRIPT-
# Move files
for f in $(git ls-files src/test/lib/); do git mv $f src/test/util/; done
git mv src/test/setup_common.cpp src/test/util/
git mv src/test/setup_common.h src/test/util/
# Replace Windows paths
sed -i -e 's|\\setup_common|\\util\\setup_common|g' $(git grep -l '\\setup_common')
sed -i -e 's|src\\test\\lib\\|src\\test\\util\\|g' build_msvc/test_bitcoin/test_bitcoin.vcxproj
# Everything else
sed -i -e 's|/setup_common|/util/setup_common|g' $(git grep -l 'setup_common')
sed -i -e 's|test/lib/|test/util/|g' $(git grep -l 'test/lib/')
# Fix include guard
sed -i -e 's|BITCOIN_TEST_SETUP_COMMON_H|BITCOIN_TEST_UTIL_SETUP_COMMON_H|g' ./src/test/util/setup_common.h
sed -i -e 's|BITCOIN_TEST_LIB_|BITCOIN_TEST_UTIL_|g' $(git grep -l 'BITCOIN_TEST_LIB_')
-END VERIFY SCRIPT-
2019-11-06 11:56:41 -05:00
practicalswift
9a841696c1
tests: Reduce compilation time and unneccessary recompiles by removing unused includes in tests
2019-06-26 20:37:48 +02:00
Steven Roose
f4889a5253
UPSTREAM MERGE BROKEN: Merge upstream commit ' 519b0bc5dc' into master
2019-05-17 16:17:09 +01:00
Gregory Sanders
693f206082
fill checkqueue_tests vector for completion checking
2019-05-15 14:01:00 -04:00
Steven Roose
7f894ae00b
UPSTREAM MERGE BROKEN: Merge commit ' f617e05c38' into master
2019-05-01 19:18:18 +01:00
MarcoFalke
0c9de67f34
Merge #15352 : tests: Reduce noise level in test_bitcoin output
...
0aef39d067 Silence "Test case [...] did not check any assertions" warnings when running "test_bitcoin --log_level=test_suite" (practicalswift)
5fd73c8694 Avoid repeated log messages in tests by connecting to signal handlers (ThreadSafeMessageBox, etc.) only once (practicalswift)
e502c3c515 tests: Reduce noise level in test_bitcoin output (practicalswift)
Pull request description:
Reduce noise level in `test_bitcoin` output.
Context: When working on the non-determinism issues in the unit tests (see #15296 ) I got a bit tired of the amount of noise in the `test_bitcoin` output :-)
Before:
```
$ src/test/test_bitcoin --log_level=test_suite 2>&1 | grep -vE '(Entering|Leaving)' | uniq -c
1 Running 341 test cases...
1 Test case blockencodings_tests/TransactionsRequestDeserializationOverflowTest did not check any assertions
1 CheckSplitTorReplyLine(PROTOCOLINFO PIVERSION)
1 CheckSplitTorReplyLine(AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/home/x/.tor/control_auth_cookie")
1 CheckSplitTorReplyLine(AUTH METHODS=NULL)
1 CheckSplitTorReplyLine(AUTH METHODS=HASHEDPASSWORD)
1 CheckSplitTorReplyLine(VERSION Tor="0.2.9.8 (git-a0df013ea241b026)")
1 CheckSplitTorReplyLine(AUTHCHALLENGE SERVERHASH=aaaa SERVERNONCE=bbbb)
1 CheckSplitTorReplyLine(COMMAND)
1 CheckSplitTorReplyLine(COMMAND SOME ARGS)
1 CheckSplitTorReplyLine(COMMAND ARGS)
1 CheckSplitTorReplyLine(COMMAND EVEN+more ARGS)
1 CheckParseTorReplyMapping(METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/home/x/.tor/control_auth_cookie")
1 CheckParseTorReplyMapping(METHODS=NULL)
1 CheckParseTorReplyMapping(METHODS=HASHEDPASSWORD)
1 CheckParseTorReplyMapping(Tor="0.2.9.8 (git-a0df013ea241b026)")
1 CheckParseTorReplyMapping(SERVERHASH=aaaa SERVERNONCE=bbbb)
1 CheckParseTorReplyMapping(ServiceID=exampleonion1234)
1 CheckParseTorReplyMapping(PrivateKey=RSA1024:BLOB)
1 CheckParseTorReplyMapping(ClientAuth=bob:BLOB)
1 CheckParseTorReplyMapping(Foo=Bar=Baz Spam=Eggs)
1 CheckParseTorReplyMapping(Foo="Bar=Baz")
1 CheckParseTorReplyMapping(Foo="Bar Baz")
1 CheckParseTorReplyMapping(Foo="Bar\ Baz")
1 CheckParseTorReplyMapping(Foo="Bar\Baz")
1 CheckParseTorReplyMapping(Foo="Bar\@Baz")
1 CheckParseTorReplyMapping(Foo="Bar\"Baz" Spam="\"Eggs\"")
1 CheckParseTorReplyMapping(Foo="Bar\\Baz")
1 CheckParseTorReplyMapping(Foo="Bar\nBaz\t" Spam="\rEggs" Octals="\1a\11\17\18\81\377\378\400\2222" Final=Check)
1 CheckParseTorReplyMapping(Valid=Mapping Escaped="Escape\\")
1 CheckParseTorReplyMapping(Valid=Mapping Bare="Escape\")
1 CheckParseTorReplyMapping(OneOctal="OneEnd\1" TwoOctal="TwoEnd\11")
1 CheckParseTorReplyMapping(Null="\0")
1 CheckParseTorReplyMapping(SOME=args,here MORE optional=arguments here)
1 CheckParseTorReplyMapping(ARGS)
1 CheckParseTorReplyMapping(MORE ARGS)
1 CheckParseTorReplyMapping(MORE ARGS)
1 CheckParseTorReplyMapping(EVEN more=ARGS)
1 CheckParseTorReplyMapping(EVEN+more ARGS)
1 Test case util_tests/util_criticalsection did not check any assertions
1 Testing known outcomes
326 Error: Specified -walletdir "/tmp/test_bitcoin/1553850209_943311758/tempdir/path_does_not_exist" does not exist
327 Error: Specified -walletdir "/tmp/test_bitcoin/1553850209_643733972/tempdir/not_a_directory.dat" is not a directory
328 Error: Specified -walletdir "wallets" is a relative path
1
1 *** No errors detected
```
After:
```
$ src/test/test_bitcoin --log_level=test_suite 2>&1 | grep -vE '(Entering|Leaving)' | uniq -c
1 Running 341 test cases...
1 Error: Specified -walletdir "/tmp/test_bitcoin/1553850026_943311758/tempdir/path_does_not_exist" does not exist
1 Error: Specified -walletdir "/tmp/test_bitcoin/1553850026_643733972/tempdir/not_a_directory.dat" is not a directory
1 Error: Specified -walletdir "wallets" is a relative path
1
1 *** No errors detected
```
ACKs for commit 0aef39:
MarcoFalke:
utACK 0aef39d067
Tree-SHA512: 9cc22f64aa5c875861bae6533d18675ad978c623f053754deef6a8e271ea70bda3f72fb4ec5c8fd19b841757f21380639051d5f5b44301b9d2464b57655e9c05
2019-04-16 14:18:47 -04:00
MarcoFalke
faf400077d
scripted-diff: Bump copyright headers in test, bench
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./src/bench/
./contrib/devtools/copyright_header.py update ./src/test/
-END VERIFY SCRIPT-
2019-04-11 13:34:43 -04:00
MarcoFalke
fa821904bf
scripted-diff: Rename test_bitcoin to test/setup_common
...
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/test_bitcoin\.(h|cpp)/setup_common.\1/g' $(git grep -l test_bitcoin)
git mv ./src/test/test_bitcoin.h ./src/test/setup_common.h
git mv ./src/test/test_bitcoin.cpp ./src/test/setup_common.cpp
sed -i -e 's/BITCOIN_TEST_TEST_BITCOIN_H/BITCOIN_TEST_SETUP_COMMON_H/g' ./src/test/setup_common.h
-END VERIFY SCRIPT-
2019-04-11 10:12:36 -04:00
practicalswift
e502c3c515
tests: Reduce noise level in test_bitcoin output
2019-03-29 15:14:09 +01:00
Steven Roose
cd56626647
[BROKEN] Adapt existing unit tests to CA
2019-03-20 12:05:50 +00:00