<p>The Bitcoin Core test <a href="https://github.com/bitcoin/bitcoin/tree/master/test" rel="nofollow noreferrer">README</a> states:</p>
<blockquote>
<p>By default, up to 4 tests will be run in parallel by test_runner. To
specify how many jobs to run, append <code>--jobs=n</code></p>
<p>The individual tests and the test_runner harness have many
command-line options. Run <code>test/functional/test_runner.py -h</code> to see
them all.</p>
</blockquote>
<p>Pieter Wuille also explained how he gets the total time down below 4 minutes on <a href="https://github.com/bitcoin/bitcoin/pull/20220#issuecomment-718283509" rel="nofollow noreferrer">GitHub</a>:</p>
<blockquote>
<p>You can run them in parallel; if you have sufficient RAM pretty extremely even. <code>test_runner.py -j60</code> works fine on my 4-core 32 GiB RAM system, taking 3m46s. A lot of the time consists of processes waiting for each other, so it's not actually CPU bound.</p>
</blockquote>
<p>If you increase parallelism some tests may end up failing due to timeouts as the functional tests require a fairly fast and unburdened system to run. Reducing parallelism and/or increasing the timeout scale (both are test runner arguments) are two approaches to try if you are experiencing failures due to timeouts.</p>
<p>Alternatively you can run functional tests on a RAM disk using these commands for Mac:</p>
<pre><code>diskutil erasevolume HFS+ RAMDisk `hdiutil attach -nomount ram://10485760` 

test/functional/test_runner.py --jobs=50 --cachedir=/Volumes/RAMDisk/cache --tmpdir=/Volumes/RAMDisk/tmp
</code></pre>
<p>Thanks to wumpus and provoostenator for adding comments on IRC.</p>

CC BY-SA 4.0
2020-10-29T11:29:08.213Z
2022-03-16T15:12:15.110Z
2022-03-16T15:12:15.110Z
Michael Folkson
<p>I am running the Bitcoin Core <a href="https://diyhpl.us/wiki/transcripts/scalingbitcoin/tel-aviv-2019/edgedevplusplus/bitcoin-core-functional-test-framework/" rel="nofollow noreferrer">functional tests</a> using the test runner and it is taking a long time to get through all the tests. Is there a way to speed it up?</p>
<pre><code>test/functional/test_runner.py --extended
</code></pre>

<bitcoin-core-development><functional-test>
Can I speed up the running of functional tests?
Michael Folkson
# Can I speed up the running of functional tests?

(Asked by: username_0 on 2020-10-29)

I am running the Bitcoin Core functional tests using the test runner and it is taking a long time to get through all the tests. Is there a way to speed it up?
test/functional/test_runner.py --extended

**Tags:** bitcoin-core-development, functional-test


---

## 1 answers

### Answer by username_0 on 2020-10-29. Score: 2 | Accepted answer

The Bitcoin Core test README states:

By default, up to 4 tests will be run in parallel by test_runner. To
specify how many jobs to run, append --jobs=n
The individual tests and the test_runner harness have many
command-line options. Run test/functional/test_runner.py -h to see
them all.

Pieter Wuille also explained how he gets the total time down below 4 minutes on GitHub:

You can run them in parallel; if you have sufficient RAM pretty extremely even. test_runner.py -j60 works fine on my 4-core 32 GiB RAM system, taking 3m46s. A lot of the time consists of processes waiting for each other, so it's not actually CPU bound.

If you increase parallelism some tests may end up failing due to timeouts as the functional tests require a fairly fast and unburdened system to run. Reducing parallelism and/or increasing the timeout scale (both are test runner arguments) are two approaches to try if you are experiencing failures due to timeouts.
Alternatively you can run functional tests on a RAM disk using these commands for Mac:
diskutil erasevolume HFS+ RAMDisk `hdiutil attach -nomount ram://10485760` 

test/functional/test_runner.py --jobs=50 --cachedir=/Volumes/RAMDisk/cache --tmpdir=/Volumes/RAMDisk/tmp

Thanks to wumpus and provoostenator for adding comments on IRC.


---

