Skip to content

Commit

Permalink
Add ut
Browse files Browse the repository at this point in the history
  • Loading branch information
JaySon-Huang committed Jul 15, 2024
1 parent 40a202e commit 9bca9b1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dbms/src/TiDB/Schema/tests/gtest_schema_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <TestUtils/TiFlashTestEnv.h>
#include <TiDB/Schema/SchemaSyncService.h>
#include <common/defines.h>
#include <common/types.h>

#include <ext/scope_guard.h>

Expand Down Expand Up @@ -418,13 +419,24 @@ try
FailPointHelper::disableFailPoint(FailPoints::force_schema_sync_too_old_schema);
});
refreshSchema();
auto tombstone_ts_by_sync_all = 0;
UInt64 tombstone_ts_by_sync_all = 0;
{
// the table should mark as tombstone != 0
auto storage = mustGetSyncedTable(logical_table_id);
tombstone_ts_by_sync_all = storage->getTombstone();
ASSERT_NE(tombstone_ts_by_sync_all, 0);
}

// trigger sync all schema again, the tombstone_ts should not change
MockTiDB::instance().newDataBase(db_name + "_copy");
refreshSchema();
{
// the table should mark as tombstone != 0
auto storage = mustGetSyncedTable(logical_table_id);
ASSERT_NE(storage->getTombstone(), 0);
// the tombstone_ts should not changed
ASSERT_EQ(storage->getTombstone(), tombstone_ts_by_sync_all);
}
}
CATCH

Expand Down

0 comments on commit 9bca9b1

Please sign in to comment.