@ -62,8 +62,9 @@ INSTANTIATE_TEST_CASE_P(
std : : make_tuple ( true , true , WRITE_PREPARED , kOrderedWrite ) ,
std : : make_tuple ( true , true , WRITE_PREPARED , kOrderedWrite ) ,
std : : make_tuple ( true , true , WRITE_UNPREPARED , kOrderedWrite ) ) ) ;
std : : make_tuple ( true , true , WRITE_UNPREPARED , kOrderedWrite ) ) ) ;
// MySQLStyleTransactionTest takes far too long for valgrind to run.
// MySQLStyleTransactionTest takes far too long for valgrind to run. Only do it
# ifndef ROCKSDB_VALGRIND_RUN
// in full mode (`ROCKSDB_FULL_VALGRIND_RUN` compiler flag is set).
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
INSTANTIATE_TEST_CASE_P (
INSTANTIATE_TEST_CASE_P (
MySQLStyleTransactionTest , MySQLStyleTransactionTest ,
MySQLStyleTransactionTest , MySQLStyleTransactionTest ,
: : testing : : Values (
: : testing : : Values (
@ -79,7 +80,7 @@ INSTANTIATE_TEST_CASE_P(
std : : make_tuple ( false , true , WRITE_UNPREPARED , kOrderedWrite , true ) ,
std : : make_tuple ( false , true , WRITE_UNPREPARED , kOrderedWrite , true ) ,
std : : make_tuple ( false , true , WRITE_PREPARED , kUnorderedWrite , false ) ,
std : : make_tuple ( false , true , WRITE_PREPARED , kUnorderedWrite , false ) ,
std : : make_tuple ( false , true , WRITE_PREPARED , kUnorderedWrite , true ) ) ) ;
std : : make_tuple ( false , true , WRITE_PREPARED , kUnorderedWrite , true ) ) ) ;
# endif // ROCKSDB_VALGRIND_RUN
# endif // !defined( ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionTest , DoubleEmptyWrite ) {
TEST_P ( TransactionTest , DoubleEmptyWrite ) {
WriteOptions write_options ;
WriteOptions write_options ;
@ -686,7 +687,7 @@ TEST_P(TransactionTest, DeadlockCycleShared) {
}
}
}
}
# ifndef ROCKSDB_VALGRIND_RUN
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionStressTest , DeadlockCycle ) {
TEST_P ( TransactionStressTest , DeadlockCycle ) {
WriteOptions write_options ;
WriteOptions write_options ;
ReadOptions read_options ;
ReadOptions read_options ;
@ -849,7 +850,7 @@ TEST_P(TransactionStressTest, DeadlockStress) {
t . join ( ) ;
t . join ( ) ;
}
}
}
}
# endif // ROCKSDB_VALGRIND_RUN
# endif // !defined( ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionTest , CommitTimeBatchFailTest ) {
TEST_P ( TransactionTest , CommitTimeBatchFailTest ) {
WriteOptions write_options ;
WriteOptions write_options ;
@ -1182,7 +1183,7 @@ TEST_P(TransactionTest, TwoPhaseEmptyWriteTest) {
}
}
}
}
# ifndef ROCKSDB_VALGRIND_RUN
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionStressTest , TwoPhaseExpirationTest ) {
TEST_P ( TransactionStressTest , TwoPhaseExpirationTest ) {
Status s ;
Status s ;
@ -1420,7 +1421,7 @@ TEST_P(TransactionTest, PersistentTwoPhaseTransactionTest) {
// deleting transaction should unregister transaction
// deleting transaction should unregister transaction
ASSERT_EQ ( db - > GetTransactionByName ( " xid " ) , nullptr ) ;
ASSERT_EQ ( db - > GetTransactionByName ( " xid " ) , nullptr ) ;
}
}
# endif // ROCKSDB_VALGRIND_RUN
# endif // !defined( ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
// TODO this test needs to be updated with serial commits
// TODO this test needs to be updated with serial commits
TEST_P ( TransactionTest , DISABLED_TwoPhaseMultiThreadTest ) {
TEST_P ( TransactionTest , DISABLED_TwoPhaseMultiThreadTest ) {
@ -1504,6 +1505,7 @@ TEST_P(TransactionTest, DISABLED_TwoPhaseMultiThreadTest) {
}
}
}
}
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionStressTest , TwoPhaseLongPrepareTest ) {
TEST_P ( TransactionStressTest , TwoPhaseLongPrepareTest ) {
WriteOptions write_options ;
WriteOptions write_options ;
write_options . sync = true ;
write_options . sync = true ;
@ -1614,6 +1616,7 @@ TEST_P(TransactionTest, TwoPhaseSequenceTest) {
ASSERT_EQ ( s , Status : : OK ( ) ) ;
ASSERT_EQ ( s , Status : : OK ( ) ) ;
ASSERT_EQ ( value , " bar4 " ) ;
ASSERT_EQ ( value , " bar4 " ) ;
}
}
# endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionTest , TwoPhaseDoubleRecoveryTest ) {
TEST_P ( TransactionTest , TwoPhaseDoubleRecoveryTest ) {
WriteOptions write_options ;
WriteOptions write_options ;
@ -5356,7 +5359,7 @@ TEST_P(TransactionStressTest, ExpiredTransactionDataRace1) {
ROCKSDB_NAMESPACE : : SyncPoint : : GetInstance ( ) - > DisableProcessing ( ) ;
ROCKSDB_NAMESPACE : : SyncPoint : : GetInstance ( ) - > DisableProcessing ( ) ;
}
}
# ifndef ROCKSDB_VALGRIND_RUN
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
namespace {
namespace {
// cmt_delay_ms is the delay between prepare and commit
// cmt_delay_ms is the delay between prepare and commit
// first_id is the id of the first transaction
// first_id is the id of the first transaction
@ -5486,7 +5489,7 @@ TEST_P(MySQLStyleTransactionTest, TransactionStressTest) {
! TAKE_SNAPSHOT ) ;
! TAKE_SNAPSHOT ) ;
ASSERT_OK ( s ) ;
ASSERT_OK ( s ) ;
}
}
# endif // ROCKSDB_VALGRIND_RUN
# endif // !defined( ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionTest , MemoryLimitTest ) {
TEST_P ( TransactionTest , MemoryLimitTest ) {
TransactionOptions txn_options ;
TransactionOptions txn_options ;
@ -5520,6 +5523,7 @@ TEST_P(TransactionTest, MemoryLimitTest) {
delete txn ;
delete txn ;
}
}
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
// This test clarifies the existing expectation from the sequence number
// This test clarifies the existing expectation from the sequence number
// algorithm. It could detect mistakes in updating the code but it is not
// algorithm. It could detect mistakes in updating the code but it is not
// necessarily the one acceptable way. If the algorithm is legitimately changed,
// necessarily the one acceptable way. If the algorithm is legitimately changed,
@ -5643,6 +5647,7 @@ TEST_P(TransactionStressTest, SeqAdvanceTest) {
ASSERT_OK ( ReOpen ( ) ) ;
ASSERT_OK ( ReOpen ( ) ) ;
}
}
}
}
# endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
// Verify that the optimization would not compromize the correctness
// Verify that the optimization would not compromize the correctness
TEST_P ( TransactionTest , Optimizations ) {
TEST_P ( TransactionTest , Optimizations ) {
@ -5693,7 +5698,7 @@ class ThreeBytewiseComparator : public Comparator {
}
}
} ;
} ;
# ifndef ROCKSDB_VALGRIND_RUN
# if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
TEST_P ( TransactionTest , GetWithoutSnapshot ) {
TEST_P ( TransactionTest , GetWithoutSnapshot ) {
WriteOptions write_options ;
WriteOptions write_options ;
std : : atomic < bool > finish = { false } ;
std : : atomic < bool > finish = { false } ;
@ -5722,7 +5727,7 @@ TEST_P(TransactionTest, GetWithoutSnapshot) {
commit_thread . join ( ) ;
commit_thread . join ( ) ;
read_thread . join ( ) ;
read_thread . join ( ) ;
}
}
# endif // ROCKSDB_VALGRIND_RUN
# endif // !defined( ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN)
// Test that the transactional db can handle duplicate keys in the write batch
// Test that the transactional db can handle duplicate keys in the write batch
TEST_P ( TransactionTest , DuplicateKeys ) {
TEST_P ( TransactionTest , DuplicateKeys ) {