You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1764849 doc: Speed up functional test runs using ramdisk (willcl-ark)
Pull request description:
Using a ramdisk for the functional tests can give noticable speedups for developers and reviewers.
Local testing with an 8GB ramdisk saw a full test run using `test/functional/test_runner.py --jobs=100 --cachedir=/mnt/tmp/cache --tmpdir=/mnt/tmp` reduced from ~280 seconds to ~99 seconds.
Possible bikeshedding opportunity to be had over whether this might best fit into `doc/productivity.md`, but IMO more people will likely see it (and it will therefore be more useful) if it is here.
It seems best to select `tmpfs` over `ramfs` as `ramfs` can grow dynamically (good) but cannot be limited in size and might cause the system to hang if you run out of ram (bad), whereas `tmpfs` is size-limited and will overflow into swap.
ACKs for top commit:
josibake:
ACK bitcoin/bitcoin@1764849
jamesob:
ACK bitcoin/bitcoin@1764849
Tree-SHA512: b8e0846d4558a7a33fbb7cd190e30c36182db36095e1c1feae8c10a12042cff9d97739964bd9211d8564231dc99b4be5eed806d12a1d11dfa908157d7f26cc67
Copy file name to clipboardExpand all lines: test/README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,34 @@ how many jobs to run, append `--jobs=n`
107
107
The individual tests and the test_runner harness have many command-line
108
108
options. Run `test/functional/test_runner.py -h` to see them all.
109
109
110
+
#### Speed up test runs with a ramdisk
111
+
112
+
If you have available RAM on your system you can create a ramdisk to use as the `cache` and `tmp` directories for the functional tests in order to speed them up.
113
+
Speed-up amount varies on each system (and according to your ram speed and other variables), but a 2-3x speed-up is not uncommon.
114
+
115
+
To create a 4GB ramdisk on Linux at `/mnt/tmp/`:
116
+
117
+
```bash
118
+
sudo mkdir -p /mnt/tmp
119
+
sudo mount -t tmpfs -o size=4g tmpfs /mnt/tmp/
120
+
```
121
+
122
+
Configure the size of the ramdisk using the `size=` option.
123
+
The size of the ramdisk needed is relative to the number of concurrent jobs the test suite runs.
124
+
For example running the test suite with `--jobs=100` might need a 4GB ramdisk, but running with `--jobs=32` will only need a 2.5GB ramdisk.
125
+
126
+
To use, run the test suite specifying the ramdisk as the `cachedir` and `tmpdir`:
0 commit comments