Skip to content

Commit 1764849

Browse files
committed
doc: Speed up functional test runs using ramdisk
Using a ramdisk for the functional tests can give worthwhile speed-ups for developers and reviewers. Add notes to test/README.md on how to setup, use and erase a ramdisk on Linux.
1 parent 9e32adb commit 1764849

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,34 @@ how many jobs to run, append `--jobs=n`
107107
The individual tests and the test_runner harness have many command-line
108108
options. Run `test/functional/test_runner.py -h` to see them all.
109109

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`:
127+
128+
```bash
129+
test/functional/test_runner.py --cachedir=/mnt/tmp/cache --tmpdir=/mnt/tmp
130+
```
131+
132+
Once finished with the tests and the disk, and to free the ram, simply unmount the disk:
133+
134+
```bash
135+
sudo umount /mnt/tmp
136+
```
137+
110138
#### Troubleshooting and debugging test failures
111139

112140
##### Resource contention

0 commit comments

Comments
 (0)