Expensify / Bedrock

Rock solid distributed database specializing in active/active automatic failover and WAN replication
https://bedrockdb.com
GNU Lesser General Public License v3.0
1.12k stars 85 forks source link

`test/test` looks for `bedrock` in the `PATH` #1618

Open tangentsoft opened 1 year ago

tangentsoft commented 1 year ago

After building the server program for the first time, bedrock is in the top-level source directory but not yet installed. If you then say test/test, you get this error:

Starting bedrock failed. Errno: 2, msg: No such file or directory, serverName: bedrock bedrock -cacheSize 1000 -commandPortPrivate 0.0.0.0:10003 -controlPort localhost:10002 -db /tmp/bedrocktest_RdhqPz.db -enableMultiWrite true -escalateOverHTTP true -extraExceptionLogging -maxJournalSize 25000 -mmapSizeGB 1 -nodeHost localhost:10001 -nodeName bedrock_test -parallelReplication true -plugins Jobs,DB -priority 200 -serverHost 127.0.0.1:10000 -testName CancelJob -v -workerThreads 8

This is because it is defaulting to "bedrock", which doesn't exist in the PATH, as consulted by execvp() in test/lib/BedrockTester.cpp.

Since testing the binary before installing it is a good plan, I suggest applying this trivial patch:

diff --git a/test/lib/BedrockTester.cpp b/test/lib/BedrockTester.cpp
index fe74c833..fff22a46 100644
--- a/test/lib/BedrockTester.cpp
+++ b/test/lib/BedrockTester.cpp
@@ -58,7 +58,7 @@ BedrockTester::BedrockTester(const map<string, string>& args,
     }

     if (bedrockBinary.empty()) {
-        serverName = "bedrock";
+        serverName = "./bedrock";
     } else {
         serverName = bedrockBinary;
     }
fukawi2 commented 1 year ago

Thanks for reporting this! This seems like a reasonable change to me - would you be willing to put up a PR for it? :)

tangentsoft commented 1 year ago

Two bytes? C'mon…

fukawi2 commented 1 year ago

I know it seems silly, but I can't approve my own PR :)

tangentsoft commented 1 year ago

No, but you can commit it and hog all the credit for the innovation, and it will be perfectly fine with me. :)