mirror of https://github.com/facebook/rocksdb.git
Disable fault injection for TestGetProperty (#12825)
Summary: **Context/Summary:** See titled; along with one more minor fix to other disabling Pull Request resolved: https://github.com/facebook/rocksdb/pull/12825 Test Plan: CI won't show `Failed to get DB property: rocksdb.aggregated-table-properties` Reviewed By: jaykorean Differential Revision: D59231819 Pulled By: hx235 fbshipit-source-id: a8e73c9e06eeceb4c6025a4885823a3eba25c359
This commit is contained in:
parent
c7e94bc878
commit
69ad597b46
|
@ -1204,7 +1204,32 @@ void StressTest::OperateDb(ThreadState* thread) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thread->rand.OneInOpt(FLAGS_get_property_one_in)) {
|
if (thread->rand.OneInOpt(FLAGS_get_property_one_in)) {
|
||||||
|
// TestGetProperty doesn't return status for us to tell whether it has
|
||||||
|
// failed due to injected error. So we disable fault injection to avoid
|
||||||
|
// false positive
|
||||||
|
if (fault_fs_guard) {
|
||||||
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kMetadataRead);
|
||||||
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kMetadataWrite);
|
||||||
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kRead);
|
||||||
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kWrite);
|
||||||
|
}
|
||||||
|
|
||||||
TestGetProperty(thread);
|
TestGetProperty(thread);
|
||||||
|
|
||||||
|
if (fault_fs_guard) {
|
||||||
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kMetadataWrite);
|
||||||
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kMetadataRead);
|
||||||
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kRead);
|
||||||
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kWrite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thread->rand.OneInOpt(FLAGS_get_properties_of_all_tables_one_in)) {
|
if (thread->rand.OneInOpt(FLAGS_get_properties_of_all_tables_one_in)) {
|
||||||
|
@ -1230,26 +1255,30 @@ void StressTest::OperateDb(ThreadState* thread) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (total_size <= FLAGS_backup_max_size && fault_fs_guard) {
|
if (total_size <= FLAGS_backup_max_size) {
|
||||||
// TODO(hx235): enable error injection with
|
// TODO(hx235): enable error injection with
|
||||||
// backup/restore after fixing the various issues it surfaces
|
// backup/restore after fixing the various issues it surfaces
|
||||||
fault_fs_guard->DisableThreadLocalErrorInjection(
|
if (fault_fs_guard) {
|
||||||
FaultInjectionIOType::kMetadataRead);
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
fault_fs_guard->DisableThreadLocalErrorInjection(
|
FaultInjectionIOType::kMetadataRead);
|
||||||
FaultInjectionIOType::kMetadataWrite);
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
fault_fs_guard->DisableThreadLocalErrorInjection(
|
FaultInjectionIOType::kMetadataWrite);
|
||||||
FaultInjectionIOType::kRead);
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
fault_fs_guard->DisableThreadLocalErrorInjection(
|
FaultInjectionIOType::kRead);
|
||||||
FaultInjectionIOType::kWrite);
|
fault_fs_guard->DisableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kWrite);
|
||||||
|
}
|
||||||
Status s = TestBackupRestore(thread, rand_column_families, rand_keys);
|
Status s = TestBackupRestore(thread, rand_column_families, rand_keys);
|
||||||
fault_fs_guard->EnableThreadLocalErrorInjection(
|
if (fault_fs_guard) {
|
||||||
FaultInjectionIOType::kMetadataWrite);
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
fault_fs_guard->EnableThreadLocalErrorInjection(
|
FaultInjectionIOType::kMetadataWrite);
|
||||||
FaultInjectionIOType::kMetadataRead);
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
fault_fs_guard->EnableThreadLocalErrorInjection(
|
FaultInjectionIOType::kMetadataRead);
|
||||||
FaultInjectionIOType::kRead);
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
fault_fs_guard->EnableThreadLocalErrorInjection(
|
FaultInjectionIOType::kRead);
|
||||||
FaultInjectionIOType::kWrite);
|
fault_fs_guard->EnableThreadLocalErrorInjection(
|
||||||
|
FaultInjectionIOType::kWrite);
|
||||||
|
}
|
||||||
ProcessStatus(shared, "Backup/restore", s);
|
ProcessStatus(shared, "Backup/restore", s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue