@@ -32,7 +32,6 @@ use hyperactor::channel::TxStatus;
32
32
use hyperactor:: clock;
33
33
use hyperactor:: clock:: Clock ;
34
34
use hyperactor:: clock:: RealClock ;
35
- use hyperactor:: config;
36
35
use hyperactor:: mailbox:: DialMailboxRouter ;
37
36
use hyperactor:: mailbox:: MailboxServer ;
38
37
use hyperactor:: mailbox:: monitored_return_handle;
@@ -59,6 +58,8 @@ use crate::alloc::AllocatorError;
59
58
use crate :: alloc:: ProcState ;
60
59
use crate :: alloc:: ProcStopReason ;
61
60
use crate :: alloc:: ProcessAllocator ;
61
+ use crate :: config;
62
+ use crate :: config:: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ;
62
63
63
64
/// Control messages sent from remote process allocator to local allocator.
64
65
#[ derive( Debug , Clone , Serialize , Deserialize , Named ) ]
@@ -407,7 +408,7 @@ impl RemoteProcessAllocator {
407
408
}
408
409
}
409
410
}
410
- _ = RealClock . sleep( config:: global:: get( config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ) ) => {
411
+ _ = RealClock . sleep( crate :: config:: global:: get( REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ) ) => {
411
412
tracing:: trace!( "sending heartbeat" ) ;
412
413
tx. post( RemoteProcessProcStateMessage :: HeartBeat ) ;
413
414
}
@@ -1208,9 +1209,9 @@ mod test {
1208
1209
1209
1210
#[ timed_test:: async_timed_test( timeout_secs = 5 ) ]
1210
1211
async fn test_simple ( ) {
1211
- let config = hyperactor :: config:: global:: lock ( ) ;
1212
+ let config = crate :: config:: global:: lock ( ) ;
1212
1213
let _guard = config. override_key (
1213
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1214
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1214
1215
Duration :: from_millis ( 100 ) ,
1215
1216
) ;
1216
1217
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
@@ -1350,9 +1351,9 @@ mod test {
1350
1351
1351
1352
#[ timed_test:: async_timed_test( timeout_secs = 15 ) ]
1352
1353
async fn test_normal_stop ( ) {
1353
- let config = hyperactor :: config:: global:: lock ( ) ;
1354
+ let config = crate :: config:: global:: lock ( ) ;
1354
1355
let _guard = config. override_key (
1355
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1356
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1356
1357
Duration :: from_millis ( 100 ) ,
1357
1358
) ;
1358
1359
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
@@ -1428,9 +1429,9 @@ mod test {
1428
1429
1429
1430
#[ timed_test:: async_timed_test( timeout_secs = 15 ) ]
1430
1431
async fn test_realloc ( ) {
1431
- let config = hyperactor :: config:: global:: lock ( ) ;
1432
+ let config = crate :: config:: global:: lock ( ) ;
1432
1433
let _guard = config. override_key (
1433
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1434
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1434
1435
Duration :: from_millis ( 100 ) ,
1435
1436
) ;
1436
1437
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
@@ -1554,7 +1555,7 @@ mod test {
1554
1555
Duration :: from_secs ( 1 ) ,
1555
1556
) ;
1556
1557
let _guard2 = config. override_key (
1557
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1558
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1558
1559
Duration :: from_millis ( 100 ) ,
1559
1560
) ;
1560
1561
@@ -1640,10 +1641,8 @@ mod test {
1640
1641
#[ timed_test:: async_timed_test( timeout_secs = 15 ) ]
1641
1642
async fn test_inner_alloc_failure ( ) {
1642
1643
let config = hyperactor:: config:: global:: lock ( ) ;
1643
- let _guard = config. override_key (
1644
- hyperactor:: config:: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1645
- Duration :: from_secs ( 60 ) ,
1646
- ) ;
1644
+ let _guard =
1645
+ config. override_key ( REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL , Duration :: from_secs ( 60 ) ) ;
1647
1646
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
1648
1647
let serve_addr = ChannelAddr :: any ( ChannelTransport :: Unix ) ;
1649
1648
let bootstrap_addr = ChannelAddr :: any ( ChannelTransport :: Unix ) ;
@@ -1727,6 +1726,7 @@ mod test {
1727
1726
mod test_alloc {
1728
1727
use std:: os:: unix:: process:: ExitStatusExt ;
1729
1728
1729
+ use REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ;
1730
1730
use hyperactor:: clock:: ClockKind ;
1731
1731
use hyperactor:: config;
1732
1732
use ndslice:: shape;
@@ -1745,7 +1745,7 @@ mod test_alloc {
1745
1745
Duration :: from_secs ( 1 ) ,
1746
1746
) ;
1747
1747
let _guard2 = config. override_key (
1748
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1748
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1749
1749
Duration :: from_millis ( 100 ) ,
1750
1750
) ;
1751
1751
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
@@ -1870,7 +1870,7 @@ mod test_alloc {
1870
1870
Duration :: from_secs ( 1 ) ,
1871
1871
) ;
1872
1872
let _guard2 = config. override_key (
1873
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1873
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
1874
1874
Duration :: from_millis ( 100 ) ,
1875
1875
) ;
1876
1876
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
@@ -1946,7 +1946,7 @@ mod test_alloc {
1946
1946
tracing:: info!( "aborting task1 allocator" ) ;
1947
1947
task1_allocator_handle. abort ( ) ;
1948
1948
RealClock
1949
- . sleep ( config:: global:: get ( config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ) * 2 )
1949
+ . sleep ( crate :: config:: global:: get ( REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ) * 2 )
1950
1950
. await ;
1951
1951
for _ in 0 ..spec. shape . slice ( ) . len ( ) / 2 {
1952
1952
let proc_state = alloc. next ( ) . await . unwrap ( ) ;
@@ -1970,7 +1970,7 @@ mod test_alloc {
1970
1970
tracing:: info!( "aborting task2 allocator" ) ;
1971
1971
task2_allocator_handle. abort ( ) ;
1972
1972
RealClock
1973
- . sleep ( config:: global:: get ( config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ) * 2 )
1973
+ . sleep ( config:: global:: get ( REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ) * 2 )
1974
1974
. await ;
1975
1975
for _ in 0 ..spec. shape . slice ( ) . len ( ) / 2 {
1976
1976
let proc_state = alloc. next ( ) . await . unwrap ( ) ;
@@ -1998,7 +1998,7 @@ mod test_alloc {
1998
1998
}
1999
1999
let config = hyperactor:: config:: global:: lock ( ) ;
2000
2000
let _guard = config. override_key (
2001
- hyperactor :: config :: REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
2001
+ REMOTE_ALLOCATOR_HEARTBEAT_INTERVAL ,
2002
2002
Duration :: from_millis ( 100 ) ,
2003
2003
) ;
2004
2004
hyperactor_telemetry:: initialize_logging ( ClockKind :: default ( ) ) ;
0 commit comments