Fix stress test failure caused by #11424 (#11470)

Summary:
The `ryw_expected_values` check only applies to when transaction is used.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11470

Reviewed By: hx235

Differential Revision: D46085614

Pulled By: jowlyzhang

fbshipit-source-id: 4757896c3a62975641adcf97db077a04a0f33030
oxigraph-main
Yu Zhang 2 years ago committed by Facebook GitHub Bot
parent 53e0b2fe6f
commit 68cc429be2
  1. 13
      db_stress_tool/no_batched_ops_stress.cc

@ -847,10 +847,17 @@ class NonBatchedOpsStressTest : public StressTest {
size_t num_of_keys = keys.size();
assert(values.size() == num_of_keys);
assert(statuses.size() == num_of_keys);
assert(ryw_expected_values.size() == num_of_keys);
for (size_t i = 0; i < num_of_keys; ++i) {
if (!check_multiget(keys[i], values[i], statuses[i],
ryw_expected_values[i])) {
bool check_result = true;
if (use_txn) {
assert(ryw_expected_values.size() == num_of_keys);
check_result = check_multiget(keys[i], values[i], statuses[i],
ryw_expected_values[i]);
} else {
check_result = check_multiget(keys[i], values[i], statuses[i],
std::nullopt /* ryw_expected_value */);
}
if (!check_result) {
break;
}
}

Loading…
Cancel
Save