forked from blue/lmdbal
a sleep to confurency test
This commit is contained in:
parent
0079f6e96e
commit
a0eebc978d
@ -182,6 +182,7 @@ TEST_F(CacheTransactionsTest, ConcurentModification) {
|
|||||||
|
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
if (pid == 0) { // I am the child
|
if (pid == 0) { // I am the child
|
||||||
|
usleep(1);
|
||||||
std::cout << "beggining second transaction" << std::endl;
|
std::cout << "beggining second transaction" << std::endl;
|
||||||
LMDBAL::WriteTransaction txn2 = db->beginTransaction(); //<--- this is where the execution should pause
|
LMDBAL::WriteTransaction txn2 = db->beginTransaction(); //<--- this is where the execution should pause
|
||||||
//and wait for the first transaction to get finished
|
//and wait for the first transaction to get finished
|
||||||
@ -234,6 +235,7 @@ TEST_F(CacheTransactionsTest, RAIIResourceFree) {
|
|||||||
|
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
if (pid == 0) { // I am the child
|
if (pid == 0) { // I am the child
|
||||||
|
usleep(1);
|
||||||
std::cout << "beggining child transaction" << std::endl;
|
std::cout << "beggining child transaction" << std::endl;
|
||||||
LMDBAL::WriteTransaction txn2 = db->beginTransaction(); //<--- this is where the execution should pause
|
LMDBAL::WriteTransaction txn2 = db->beginTransaction(); //<--- this is where the execution should pause
|
||||||
//and wait for the first transaction to get finished
|
//and wait for the first transaction to get finished
|
||||||
|
Loading…
Reference in New Issue
Block a user