11
11
#include " sector_storage/schedulder_utils.hpp"
12
12
#include " storage/in_memory/in_memory_storage.hpp"
13
13
#include " testutil/mocks/sector_storage/selector_mock.hpp"
14
+ #include " testutil/mocks/sector_storage/worker_mock.hpp"
14
15
#include " testutil/outcome.hpp"
15
16
16
17
namespace fc ::sector_storage {
@@ -72,9 +73,10 @@ namespace fc::sector_storage {
72
73
scheduler_ = scheduler;
73
74
74
75
std::unique_ptr<WorkerHandle> worker = std::make_unique<WorkerHandle>();
76
+ mock_worker_ = std::make_unique<WorkerMock>();
75
77
76
78
worker_name_ = " worker" ;
77
-
79
+ worker-> worker = mock_worker_;
78
80
worker->info = WorkerInfo{
79
81
.hostname = worker_name_,
80
82
.resources = WorkerResources{.physical_memory = uint64_t (1 ) << 20 ,
@@ -89,7 +91,7 @@ namespace fc::sector_storage {
89
91
90
92
std::string worker_name_;
91
93
std::vector<WorkState> states_;
92
-
94
+ std::shared_ptr<WorkerMock> mock_worker_;
93
95
std::shared_ptr<boost::asio::io_context> io_;
94
96
RegisteredSealProof seal_proof_type_;
95
97
std::shared_ptr<InMemoryStorage> kv_;
@@ -340,6 +342,9 @@ namespace fc::sector_storage {
340
342
is_first_called = true ;
341
343
};
342
344
345
+ EXPECT_CALL (*mock_worker_, isLocalWorker ())
346
+ .WillOnce (testing::Return (false ));
347
+
343
348
EXPECT_CALL (
344
349
*selector_,
345
350
is_satisfying (task, seal_proof_type_, workerNameMatcher (worker_name_)))
0 commit comments