#include "gtest/gtest.h" #include "distributed/plan_dispatcher.hpp" #include "distributed_common.hpp" #include "query/context.hpp" #include "query/distributed/plan/ops.hpp" #include "query/interpret/frame.hpp" class DistributedReset : public DistributedGraphDbTest { protected: DistributedReset() : DistributedGraphDbTest("reset") {} }; TEST_F(DistributedReset, ResetTest) { query::SymbolTable symbol_table; auto once = std::make_shared(); auto pull_remote = std::make_shared( once, 42, std::vector()); master().plan_dispatcher().DispatchPlan(42, once, symbol_table); auto dba = master().Access(); query::Frame frame(0); query::ExecutionContext context{dba.get()}; auto pull_remote_cursor = pull_remote->MakeCursor(dba.get(), utils::NewDeleteResource()); for (int i = 0; i < 3; ++i) { EXPECT_TRUE(pull_remote_cursor->Pull(frame, context)); } EXPECT_FALSE(pull_remote_cursor->Pull(frame, context)); pull_remote_cursor->Reset(); for (int i = 0; i < 3; ++i) { EXPECT_TRUE(pull_remote_cursor->Pull(frame, context)); } EXPECT_FALSE(pull_remote_cursor->Pull(frame, context)); }