Skip to content

Commit 62ac3b4

Browse files
author
Matthew Zipkin
committed
docs: add ramdisk guide for running tests on OSX
1 parent a245429 commit 62ac3b4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ options. Run `test/functional/test_runner.py -h` to see them all.
114114
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.
115115
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.
116116

117+
**Linux**
118+
117119
To create a 4GB ramdisk on Linux at `/mnt/tmp/`:
118120

119121
```bash
@@ -137,6 +139,27 @@ Once finished with the tests and the disk, and to free the ram, simply unmount t
137139
sudo umount /mnt/tmp
138140
```
139141

142+
**OSX**
143+
144+
To create a 4GB ramdisk named "ramdisk" on OSX at `/Volumes/ramdisk/`:
145+
146+
```bash
147+
diskutil erasevolume HFS+ ramdisk $(hdiutil attach -nomount ram://8388608)
148+
```
149+
150+
Configure the size at the end of the command, in terms of block size
151+
(`8388608 / 2048 = 4096` or 4 GB). To run the tests using the ramdisk:
152+
153+
```bash
154+
test/functional/test_runner.py --cachedir=/Volumes/ramdisk/cache --tmpdir=/Volumes/ramdisk/tmp
155+
```
156+
157+
To unmount:
158+
159+
```bash
160+
umount /Volumes/ramdisk
161+
```
162+
140163
#### Troubleshooting and debugging test failures
141164

142165
##### Resource contention

0 commit comments

Comments
 (0)