How to test (on macOS)?

(Dennis Schafroth) #1


There is very little information about how to test…

If I do PR or extension, I would very much like to do some regression testing before delivering.

I can see that somebody has written that you can do a simulation with fdbserver but I seem to be missing some test suite,

And tried the simulation run on macOS but that fails with "ERROR: Could not locate shared memory - ‘machineId’ " on my first attempt. Running with dtruss doesn’t show to me what goes wrong:

munmap(0x110F7E000, 0x3E8)|| = 0 0|
mkdir("/tmp/boost_interprocess\0", 0x1FF, 0x0)|| = -1 Err#17|
open("/tmp/boost_interprocess/fdbserver\0", 0x0, 0x1)|| = 7 0|
fstat64(0x7, 0x7FFEE0545160, 0x0)|| = 0 0|
fstat64(0x7, 0x7FFEE0545030, 0x0)|| = 0 0|
mmap(0x0, 0x3E8, 0x1, 0x1, 0x7, 0x0)|| = 0x110F7E000 0|
close(0x7)|| = 0 0|

So are there known ways to test on macOS ?

How to complie and debug FDB (on mac os)?
(Alex Miller) #2

Can you post your invocation line, and any other potentially relevant information about your environment? (MacOS version?)

I’m on a checkout of your PR, and ./bin/fdbserver -r simulation -b on -s 1 -f tests/fast/AtomicOps.txt … well… okay it appears to crash, but at a different point that you’re commenting on. But I guess I’ll go look into that in the meantime.

I did manage to also break boost_interprocess, and had to go rm -rf /tmp/boost_interprocess to get myself out of fdbserver just hanging at startup. Worth a try for you as well? You might also wish to just double check the permissions on /tmp/ and /tmp/boost_interprocess/ to double check that you have rwx.

(Dennis Schafroth) #3

masOS 10.13.4 on macbook pro retina 2015, 16GB

I felt over this in the forum
$ ./bin/fdbserver -r simulation -f tests/fast/Sideband.txt -s 1234
and later with dtruss
$ dtruss ./bin/fdbserver -r simulation -f tests/fast/Sideband.txt -s 1234

This failed the same way for me as the other before I cleaned the /tmp. Now it’s running…

(Dennis Schafroth) #4

And still is. 1:30 hour in. How long does it run?

(Alec Grieser) #5

This test should be pretty fast. I ran it in about a minute on my machine, to give you a ballpark estimate.

I’ve seen it hang on my machine if the TLS plugin isn’t available. I described how one would set the right environment variables to get the TLS plugin loaded in another post, but that post was in the context of running it on Linux in the Docker container. If you wanted to run simulation on macOS, you will need to build the TLS plugin for that platform, and we don’t currently have build instructions for that, but we do have an issue to add them.

(Alex Miller) #6

Tests should take < 5min, and if you open the trace file, the “Time” field should stay under 300 for most tests. (Some backup-related tests end up taking a bit longer).

I’ll go look into if we can handle not having the TLS Plugin available better. It’s possible that we don’t notice since all of us happen to have a TLS Plugin laying around anyway.

(Alex Miller) #7

For what it’s worth, this crash finally got tracked down to alligned_alloc silently failing on macOS. So I think simulation on macOS should be back to fully working.