diff --git a/contrib/TestHarness/Program.cs.cmake b/contrib/TestHarness/Program.cs.cmake index c9edc4f29b..ab5d557dfd 100644 --- a/contrib/TestHarness/Program.cs.cmake +++ b/contrib/TestHarness/Program.cs.cmake @@ -247,6 +247,7 @@ namespace SummarizeTest string testFile = null; string testDir = ""; string oldServerName = ""; + bool noSim = false; if (Directory.Exists(testFolder)) { @@ -255,9 +256,10 @@ namespace SummarizeTest if( Directory.Exists(Path.Combine(testFolder, "slow")) ) poolSize += 5; if( Directory.Exists(Path.Combine(testFolder, "fast")) ) poolSize += 14; if( Directory.Exists(Path.Combine(testFolder, "restarting")) ) poolSize += 1; + if( Directory.Exists(Path.Combine(testFolder, "noSim")) ) poolSize += 1; if( poolSize == 0 ) { - Console.WriteLine("Passed folder ({0}) did not have a fast, slow, rare, or restarting sub-folder", testFolder); + Console.WriteLine("Passed folder ({0}) did not have a fast, slow, rare, restarting, or noSim sub-folder", testFolder); return 1; } int selection = random.Next(poolSize); @@ -273,11 +275,20 @@ namespace SummarizeTest testDir = Path.Combine(testFolder, "restarting"); else { - if (Directory.Exists(Path.Combine(testFolder, "slow"))) selectionWindow += 5; + if (Directory.Exists(Path.Combine(testFolder, "noSim"))) selectionWindow += 1; if (selection < selectionWindow) - testDir = Path.Combine(testFolder, "slow"); + { + testDir = Path.Combine(testFolder, "noSim"); + noSim = true; + } else - testDir = Path.Combine(testFolder, "fast"); + { + if (Directory.Exists(Path.Combine(testFolder, "slow"))) selectionWindow += 5; + if (selection < selectionWindow) + testDir = Path.Combine(testFolder, "slow"); + else + testDir = Path.Combine(testFolder, "fast"); + } } } string[] files = Directory.GetFiles(testDir, "*", SearchOption.AllDirectories); @@ -342,11 +353,11 @@ namespace SummarizeTest bool useNewPlugin = (oldServerName == fdbserverName) || versionGreaterThanOrEqual(oldServerName.Split('-').Last(), "5.2.0"); bool useToml = File.Exists(testFile + "-1.toml"); string testFile1 = useToml ? testFile + "-1.toml" : testFile + "-1.txt"; - result = RunTest(firstServerName, useNewPlugin ? tlsPluginFile : tlsPluginFile_5_1, summaryFileName, errorFileName, seed, buggify, testFile1, runDir, uid, expectedUnseed, out unseed, out retryableError, logOnRetryableError, useValgrind, false, true, oldServerName, traceToStdout); + result = RunTest(firstServerName, useNewPlugin ? tlsPluginFile : tlsPluginFile_5_1, summaryFileName, errorFileName, seed, buggify, testFile1, runDir, uid, expectedUnseed, out unseed, out retryableError, logOnRetryableError, useValgrind, false, true, oldServerName, traceToStdout, noSim); if (result == 0) { string testFile2 = useToml ? testFile + "-2.toml" : testFile + "-2.txt"; - result = RunTest(secondServerName, tlsPluginFile, summaryFileName, errorFileName, seed+1, buggify, testFile2, runDir, uid, expectedUnseed, out unseed, out retryableError, logOnRetryableError, useValgrind, true, false, oldServerName, traceToStdout); + result = RunTest(secondServerName, tlsPluginFile, summaryFileName, errorFileName, seed+1, buggify, testFile2, runDir, uid, expectedUnseed, out unseed, out retryableError, logOnRetryableError, useValgrind, true, false, oldServerName, traceToStdout, noSim); } } else @@ -354,13 +365,13 @@ namespace SummarizeTest int expectedUnseed = -1; if (!useValgrind && unseedCheck) { - result = RunTest(fdbserverName, tlsPluginFile, null, null, seed, buggify, testFile, runDir, Guid.NewGuid().ToString(), -1, out expectedUnseed, out retryableError, logOnRetryableError, false, false, false, "", traceToStdout); + result = RunTest(fdbserverName, tlsPluginFile, null, null, seed, buggify, testFile, runDir, Guid.NewGuid().ToString(), -1, out expectedUnseed, out retryableError, logOnRetryableError, false, false, false, "", traceToStdout, noSim); } if (!retryableError) { int unseed; - result = RunTest(fdbserverName, tlsPluginFile, summaryFileName, errorFileName, seed, buggify, testFile, runDir, Guid.NewGuid().ToString(), expectedUnseed, out unseed, out retryableError, logOnRetryableError, useValgrind, false, false, "", traceToStdout); + result = RunTest(fdbserverName, tlsPluginFile, summaryFileName, errorFileName, seed, buggify, testFile, runDir, Guid.NewGuid().ToString(), expectedUnseed, out unseed, out retryableError, logOnRetryableError, useValgrind, false, false, "", traceToStdout, noSim); } } @@ -375,7 +386,7 @@ namespace SummarizeTest private static int RunTest(string fdbserverName, string tlsPluginFile, string summaryFileName, string errorFileName, int seed, bool buggify, string testFile, string runDir, string uid, int expectedUnseed, out int unseed, out bool retryableError, bool logOnRetryableError, bool useValgrind, bool restarting = false, - bool willRestart = false, string oldBinaryName = "", bool traceToStdout = false) + bool willRestart = false, string oldBinaryName = "", bool traceToStdout = false, bool noSim = false) { unseed = -1; @@ -409,16 +420,17 @@ namespace SummarizeTest tlsPluginArg = "--tls_plugin=" + tlsPluginFile; } process.StartInfo.RedirectStandardOutput = true; + string role = (noSim) ? "test" : "simulation"; var args = ""; if (willRestart && oldBinaryName.EndsWith("alpha6")) { - args = string.Format("-Rs 1000000000 -r simulation {0} -s {1} -f \"{2}\" -b {3} {4} --crash", - IsRunningOnMono() ? "" : "-q", seed, testFile, buggify ? "on" : "off", tlsPluginArg); + args = string.Format("-Rs 1000000000 -r {0} {1} -s {2} -f \"{3}\" -b {4} {5} --crash", + role, IsRunningOnMono() ? "" : "-q", seed, testFile, buggify ? "on" : "off", tlsPluginArg); } else { - args = string.Format("-Rs 1GB -r simulation {0} -s {1} -f \"{2}\" -b {3} {4} --crash", - IsRunningOnMono() ? "" : "-q", seed, testFile, buggify ? "on" : "off", tlsPluginArg); + args = string.Format("-Rs 1GB -r {0} {1} -s {2} -f \"{3}\" -b {4} {5} --crash", + role, IsRunningOnMono() ? "" : "-q", seed, testFile, buggify ? "on" : "off", tlsPluginArg); } if (restarting) args = args + " --restarting"; if (useValgrind && !willRestart) diff --git a/fdbserver/KeyValueStoreRocksDB.actor.cpp b/fdbserver/KeyValueStoreRocksDB.actor.cpp index 7377a6d5cf..2f2c77c42e 100644 --- a/fdbserver/KeyValueStoreRocksDB.actor.cpp +++ b/fdbserver/KeyValueStoreRocksDB.actor.cpp @@ -488,7 +488,7 @@ IKeyValueStore* keyValueStoreRocksDB(std::string const& path, namespace { -TEST_CASE("fdbserver/KeyValueStoreRocksDB/Reopen") { +TEST_CASE("noSim/fdbserver/KeyValueStoreRocksDB/Reopen") { state const std::string rocksDBTestDir = "rocksdb-kvstore-reopen-test-db"; platform::eraseDirectoryRecursive(rocksDBTestDir); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f84abc0faf..d1b08d9ffd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -155,6 +155,7 @@ if(WITH_PYTHON) add_fdb_test(TEST_FILES fast/Watches.toml) add_fdb_test(TEST_FILES fast/WriteDuringRead.toml) add_fdb_test(TEST_FILES fast/WriteDuringReadClean.toml) + add_fdb_test(TEST_FILES noSim/RandomUnitTests.toml) add_fdb_test(TEST_FILES rare/CheckRelocation.toml) add_fdb_test(TEST_FILES rare/ClogUnclog.toml) add_fdb_test(TEST_FILES rare/CloggedCycleWithKills.toml) diff --git a/tests/noSim/RandomUnitTests.toml b/tests/noSim/RandomUnitTests.toml new file mode 100644 index 0000000000..769ea7596f --- /dev/null +++ b/tests/noSim/RandomUnitTests.toml @@ -0,0 +1,9 @@ +[[test]] +testTitle = 'UnitTests' +useDB = false +startDelay = 0 + + [[test.workload]] + testName = 'UnitTests' + maxTestCases = 1 + testsMatching = 'noSim/'