MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_record_event_updates_activity

Function test_record_event_updates_activity

core/src/ahp/executor_tests.rs:366–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364
365#[test]
366fn test_record_event_updates_activity() {
367 let executor = make_test_executor();
368 let old_time = std::time::SystemTime::now()
369 .duration_since(std::time::UNIX_EPOCH)
370 .unwrap()
371 .as_millis() as u64
372 - 1_000;
373 executor.last_activity.store(old_time, Ordering::Relaxed);
374
375 let before = executor.last_activity.load(Ordering::Relaxed);
376 executor.record_event();
377 let after = executor.last_activity.load(Ordering::Relaxed);
378
379 assert!(after > before);
380 assert!(executor.get_idle_duration_ms() < 1_000);
381}

Callers

nothing calls this directly

Calls 5

make_test_executorFunction · 0.85
nowFunction · 0.85
storeMethod · 0.80
loadMethod · 0.45
record_eventMethod · 0.45

Tested by

no test coverage detected