| 1550 | } |
| 1551 | |
| 1552 | TEST(TestMetaClientMock, Retry) { |
| 1553 | auto doTest = [](ServerSelectionMode mode) -> CoTask<void> { |
| 1554 | MetaClient::Config config; |
| 1555 | config.retry_default().set_retry_init_wait(1_ms); |
| 1556 | config.retry_default().set_retry_max_wait(1_ms); |
| 1557 | config.retry_default().set_retry_total_time(5_s); |
| 1558 | config.set_selection_mode(mode); |
| 1559 | |
| 1560 | auto state = std::make_shared<MockMetaService::State>(); |
| 1561 | state->enableInject = true; |
| 1562 | auto meta = createInjectedMeta(config, state); |
| 1563 | |
| 1564 | for (size_t i = 0; i < 10; i++) { |
| 1565 | auto result = co_await meta->stat({}, InodeId::root(), "random-path", true); |
| 1566 | CO_ASSERT_OK(result); |
| 1567 | } |
| 1568 | for (size_t i = 0; i < 10; i++) { |
| 1569 | auto session = Uuid::random(); |
| 1570 | auto result = co_await meta->open({}, InodeId::root(), "random-path", session, O_RDWR); |
| 1571 | CO_ASSERT_OK(result); |
| 1572 | } |
| 1573 | }; |
| 1574 | |
| 1575 | magic_enum::enum_for_each<ServerSelectionMode>([&](auto mode) { folly::coro::blockingWait(doTest(mode)); }); |
| 1576 | } |
| 1577 | |
| 1578 | TEST(TestMetaClientMock, CloseAndPruneSession) { |
| 1579 | MetaClient::Config config; |
nothing calls this directly
no test coverage detected