make spawnProcess predictable in the simulator
This commit is contained in:
parent
4083af0b01
commit
dcd2d96751
|
@ -93,7 +93,14 @@ ACTOR Future<int> spawnProcess(std::string binPath, std::vector<std::string> par
|
|||
state double runTime = 0;
|
||||
state boost::process::child c(binPath, boost::process::args(paramList),
|
||||
boost::process::std_err > boost::process::null);
|
||||
if (!isSync) {
|
||||
|
||||
// for async calls in simulator, always delay by a fixed time, otherwise
|
||||
// the predictability of the simulator breaks
|
||||
if (!isSync && g_network->isSimulated()) {
|
||||
wait(delay(g_random->random01()));
|
||||
}
|
||||
|
||||
if (!isSync && !g_network->isSimulated()) {
|
||||
while (c.running() && runTime <= maxWaitTime) {
|
||||
wait(delay(0.1));
|
||||
runTime += 0.1;
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "fdbclient/NativeAPI.actor.h"
|
||||
#include "fdbclient/Notified.h"
|
||||
#include "fdbclient/KeyRangeMap.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "fdbclient/RunTransaction.actor.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "fdbserver/WorkerInterface.actor.h"
|
||||
#include "fdbserver/TLogInterface.h"
|
||||
#include "fdbserver/Knobs.h"
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "fdbclient/NativeAPI.actor.h"
|
||||
#include "fdbclient/Notified.h"
|
||||
#include "fdbclient/KeyRangeMap.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "fdbclient/RunTransaction.actor.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "fdbserver/WorkerInterface.actor.h"
|
||||
#include "fdbserver/TLogInterface.h"
|
||||
#include "fdbserver/Knobs.h"
|
||||
|
|
Loading…
Reference in New Issue