mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 11:43:49 +00:00
Fix TransactionTest.TwoPhaseMultiThreadTest under TSAN
Summary: TransactionTest.TwoPhaseMultiThreadTest runs forever under TSAN and our CI builds time out looks like the reason is that some threads keep running and other threads dont get a chance to increment the counter Test Plan: run the test under TSAN Reviewers: sdong, horuff Reviewed By: horuff Subscribers: andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D58359
This commit is contained in:
parent
1f0142ce19
commit
2ead115116
|
@ -602,11 +602,13 @@ TEST_F(TransactionTest, TwoPhaseMultiThreadTest) {
|
||||||
t_wait_on_prepare.fetch_add(1);
|
t_wait_on_prepare.fetch_add(1);
|
||||||
// wait for friends
|
// wait for friends
|
||||||
while (t_wait_on_prepare.load() < NUM_TXN_THREADS) {
|
while (t_wait_on_prepare.load() < NUM_TXN_THREADS) {
|
||||||
|
env_->SleepForMicroseconds(10);
|
||||||
}
|
}
|
||||||
} else if (writer->ShouldWriteToMemtable()) {
|
} else if (writer->ShouldWriteToMemtable()) {
|
||||||
t_wait_on_commit.fetch_add(1);
|
t_wait_on_commit.fetch_add(1);
|
||||||
// wait for friends
|
// wait for friends
|
||||||
while (t_wait_on_commit.load() < NUM_TXN_THREADS) {
|
while (t_wait_on_commit.load() < NUM_TXN_THREADS) {
|
||||||
|
env_->SleepForMicroseconds(10);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT_TRUE(false);
|
ASSERT_TRUE(false);
|
||||||
|
|
Loading…
Reference in a new issue