Skip to content

Commit 0e99702

Browse files
committed
Fix the scheduler testing
1 parent c49c8cc commit 0e99702

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

nativelink-redis-tester/src/dynamic_fake_redis.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ impl<S: SubscriptionManagerNotify + Send + 'static + Sync> FakeRedisBackend<S> {
9494
};
9595

9696
let ret: Value = match cmd.as_str() {
97+
"HELLO" => Value::Map(vec![(
98+
Value::SimpleString("server".into()),
99+
Value::SimpleString("redis".into()),
100+
)]),
97101
"CLIENT" => {
98102
// We can safely ignore these, as it's just setting the library name/version
99103
Value::Int(0)

nativelink-redis-tester/src/fake_redis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn setinfo(responses: &mut HashMap<String, String>) {
105105
.arg("redis-rs"),
106106
);
107107
responses.insert(
108-
vec![hello.clone(), setinfo.clone()].join(""),
108+
[hello.clone(), setinfo.clone()].join(""),
109109
args_as_string(vec![
110110
Value::Map(vec![(
111111
Value::SimpleString("server".into()),
@@ -116,7 +116,7 @@ fn setinfo(responses: &mut HashMap<String, String>) {
116116
]),
117117
);
118118
responses.insert(
119-
vec![hello, cmd_as_string(redis::cmd("SELECT").arg(3)), setinfo].join(""),
119+
[hello, cmd_as_string(redis::cmd("SELECT").arg(3)), setinfo].join(""),
120120
args_as_string(vec![
121121
Value::Map(vec![(
122122
Value::SimpleString("server".into()),

nativelink-scheduler/tests/redis_store_awaited_action_db_test.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async fn add_action_smoke_test() -> Result<(), Error> {
144144
..Default::default()
145145
};
146146
let store = RedisStore::new_standard(spec).await.expect("Working spec");
147-
fake_redis_backend.set_subscription_manager(store.subscription_manager().unwrap());
147+
fake_redis_backend.set_subscription_manager(store.subscription_manager().await.unwrap());
148148

149149
let notifier = Arc::new(Notify::new());
150150
let awaited_action_db = StoreAwaitedActionDb::new(
@@ -153,6 +153,7 @@ async fn add_action_smoke_test() -> Result<(), Error> {
153153
MockInstantWrapped::default,
154154
move || WORKER_OPERATION_ID.into(),
155155
)
156+
.await
156157
.unwrap();
157158

158159
let mut subscription = awaited_action_db
@@ -249,7 +250,7 @@ async fn test_multiple_clients_subscribe_to_same_action() -> Result<(), Error> {
249250
..Default::default()
250251
};
251252
let store = RedisStore::new_standard(spec).await.expect("Working spec");
252-
fake_redis_backend.set_subscription_manager(store.subscription_manager().unwrap());
253+
fake_redis_backend.set_subscription_manager(store.subscription_manager().await.unwrap());
253254

254255
let notifier = Arc::new(Notify::new());
255256
let worker_operation_id = Arc::new(Mutex::new(WORKER_OPERATION_ID_1));
@@ -260,6 +261,7 @@ async fn test_multiple_clients_subscribe_to_same_action() -> Result<(), Error> {
260261
MockInstantWrapped::default,
261262
move || worker_operation_id_clone.lock().clone().into(),
262263
)
264+
.await
263265
.unwrap();
264266

265267
let task_change_notify = Arc::new(Notify::new());
@@ -415,6 +417,7 @@ async fn test_outdated_version() -> Result<(), Error> {
415417
MockInstantWrapped::default,
416418
move || worker_operation_id_clone.lock().clone().into(),
417419
)
420+
.await
418421
.unwrap();
419422

420423
let worker_awaited_action = make_awaited_action("WORKER_OPERATION_ID");
@@ -462,7 +465,7 @@ async fn test_orphaned_client_operation_id_returns_none() -> Result<(), Error> {
462465
..Default::default()
463466
};
464467
let store = RedisStore::new_standard(spec).await.expect("Working spec");
465-
fake_redis_backend.set_subscription_manager(store.subscription_manager().unwrap());
468+
fake_redis_backend.set_subscription_manager(store.subscription_manager().await.unwrap());
466469

467470
// Manually set up the orphaned state in the fake backend:
468471
// 1. Add client_id → operation_id mapping (cid_* key)
@@ -488,6 +491,7 @@ async fn test_orphaned_client_operation_id_returns_none() -> Result<(), Error> {
488491
MockInstantWrapped::default,
489492
move || worker_operation_id_clone.lock().clone().into(),
490493
)
494+
.await
491495
.unwrap();
492496

493497
// Try to get the awaited action by the client operation ID

0 commit comments

Comments
 (0)