MCPcopy Create free account
hub / github.com/deepseek-ai/3FS / TEST

Function TEST

tests/client/TestMetaClient.cc:1552–1576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1550}
1551
1552TEST(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
1578TEST(TestMetaClientMock, CloseAndPruneSession) {
1579 MetaClient::Config config;

Callers

nothing calls this directly

Calls 15

createInjectedMetaFunction · 0.85
createFunction · 0.85
selectNodeByTypeFunction · 0.85
selectActiveNodeFunction · 0.85
hasErrorMethod · 0.80
push_backMethod · 0.80
checkClosedMethod · 0.80
checkPrunedMethod · 0.80
getNodeByMethod · 0.80
cloneRoutingInfoMethod · 0.80
clearNodesMethod · 0.80
addNodesMethod · 0.80

Tested by

no test coverage detected