test: move ReplicaofRejectOnLoad test from pytest into unit tests (#4410)

This commit is contained in:
Borys 2025-01-07 10:20:36 +02:00 committed by GitHub
parent 21fcf5808e
commit ed1436bb29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -821,6 +821,14 @@ TEST_F(DflyEngineTest, StreamMemInfo) {
EXPECT_GT(stream_mem_second, 0);
}
TEST_F(DflyEngineTest, ReplicaofRejectOnLoad) {
service_->SwitchState(GlobalState::ACTIVE, GlobalState::LOADING);
RespExpr res = Run({"REPLICAOF", "localhost", "3779"});
ASSERT_THAT(res, ErrArg("LOADING Dragonfly is loading the dataset in memory"));
}
// TODO: to test transactions with a single shard since then all transactions become local.
// To consider having a parameter in dragonfly engine controlling number of shards
// unconditionally from number of cpus. TO TEST BLPOP under multi for single/multi argument case.