| 260 | } |
| 261 | |
| 262 | static bool test_error(const ghobject_t& o, |
| 263 | std::map<ghobject_t,std::pair<int64_t,int64_t>> *failures) |
| 264 | { |
| 265 | std::lock_guard<ceph::recursive_mutex> l(lock); |
| 266 | auto it = failures->find(o); |
| 267 | if (it == failures->end()) { |
| 268 | ghobject_t os = o; |
| 269 | os.hobj.oid.name = "*"; |
| 270 | os.hobj.set_hash(0); |
| 271 | it = failures->find(os); |
| 272 | } |
| 273 | if (it != failures->end()) { |
| 274 | auto && [when,duration] = it->second; |
| 275 | if (when > 0) { |
| 276 | when--; |
| 277 | return false; |
| 278 | } |
| 279 | if (--duration <= 0) { |
| 280 | failures->erase(it); |
| 281 | } |
| 282 | return true; |
| 283 | } |
| 284 | return false; |
| 285 | } |
| 286 | |
| 287 | bool test_read_error0(const ghobject_t& o) |
| 288 | { |
no test coverage detected