@@ -277,7 +277,7 @@ async fn test_unban_if_expired_checks_pool_health() {
277277 ban. ban ( Error :: ServerError , Duration :: from_millis ( 50 ) ) ;
278278 assert ! ( ban. banned( ) ) ;
279279
280- pool. inner ( ) . health . toggle ( false ) ;
280+ pool. inner ( ) . health ( ) . toggle ( false ) ;
281281
282282 sleep ( Duration :: from_millis ( 60 ) ) . await ;
283283
@@ -814,7 +814,7 @@ async fn test_monitor_shuts_down_on_notify() {
814814async fn test_monitor_bans_unhealthy_target ( ) {
815815 let replicas = setup_test_replicas ( ) ;
816816
817- replicas. targets [ 0 ] . health . toggle ( false ) ;
817+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
818818
819819 sleep ( Duration :: from_millis ( 400 ) ) . await ;
820820
@@ -851,7 +851,7 @@ async fn test_monitor_does_not_ban_single_target() {
851851 ) ;
852852 replicas. launch ( ) ;
853853
854- replicas. targets [ 0 ] . health . toggle ( false ) ;
854+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
855855
856856 sleep ( Duration :: from_millis ( 400 ) ) . await ;
857857
@@ -864,8 +864,8 @@ async fn test_monitor_does_not_ban_single_target() {
864864async fn test_monitor_unbans_all_when_all_unhealthy ( ) {
865865 let replicas = setup_test_replicas ( ) ;
866866
867- replicas. targets [ 0 ] . health . toggle ( false ) ;
868- replicas. targets [ 1 ] . health . toggle ( false ) ;
867+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
868+ replicas. targets [ 1 ] . health ( ) . toggle ( false ) ;
869869
870870 sleep ( Duration :: from_millis ( 400 ) ) . await ;
871871
@@ -924,7 +924,7 @@ async fn test_monitor_does_not_ban_with_zero_ban_timeout() {
924924 ) ;
925925 replicas. launch ( ) ;
926926
927- replicas. targets [ 0 ] . health . toggle ( false ) ;
927+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
928928
929929 sleep ( Duration :: from_millis ( 400 ) ) . await ;
930930
@@ -942,9 +942,9 @@ async fn test_monitor_health_state_race() {
942942
943943 let toggle_task = spawn ( async move {
944944 for _ in 0 ..50 {
945- target. health . toggle ( false ) ;
945+ target. health ( ) . toggle ( false ) ;
946946 sleep ( Duration :: from_micros ( 100 ) ) . await ;
947- target. health . toggle ( true ) ;
947+ target. health ( ) . toggle ( true ) ;
948948 sleep ( Duration :: from_micros ( 100 ) ) . await ;
949949 }
950950 } ) ;
@@ -954,7 +954,7 @@ async fn test_monitor_health_state_race() {
954954 toggle_task. await . unwrap ( ) ;
955955
956956 let banned = replicas. targets [ 0 ] . ban . banned ( ) ;
957- let healthy = replicas. targets [ 0 ] . health . healthy ( ) ;
957+ let healthy = replicas. targets [ 0 ] . health ( ) . healthy ( ) ;
958958
959959 assert ! (
960960 !banned || !healthy,
@@ -1471,7 +1471,7 @@ async fn test_monitor_unbans_all_when_second_target_becomes_unhealthy_after_firs
14711471 let replicas = setup_test_replicas ( ) ;
14721472
14731473 // First target becomes unhealthy
1474- replicas. targets [ 0 ] . health . toggle ( false ) ;
1474+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
14751475
14761476 // Wait for monitor to ban the first target
14771477 sleep ( Duration :: from_millis ( 400 ) ) . await ;
@@ -1486,7 +1486,7 @@ async fn test_monitor_unbans_all_when_second_target_becomes_unhealthy_after_firs
14861486 ) ;
14871487
14881488 // Now second target becomes unhealthy (first is already banned)
1489- replicas. targets [ 1 ] . health . toggle ( false ) ;
1489+ replicas. targets [ 1 ] . health ( ) . toggle ( false ) ;
14901490
14911491 // Wait for monitor to process - should unban all since all are unhealthy
14921492 sleep ( Duration :: from_millis ( 400 ) ) . await ;
@@ -1739,7 +1739,7 @@ fn test_ban_check_does_not_clear_expired_ban_when_healthy_with_bad_lag() {
17391739 let replicas = setup_test_replicas_no_launch ( ) ;
17401740
17411741 // Target is healthy (default)
1742- assert ! ( replicas. targets[ 0 ] . health. healthy( ) ) ;
1742+ assert ! ( replicas. targets[ 0 ] . health( ) . healthy( ) ) ;
17431743
17441744 // Ban with short timeout
17451745 replicas. targets [ 0 ]
@@ -1776,7 +1776,7 @@ fn test_ban_check_does_not_clear_expired_ban_when_unhealthy_with_bad_lag() {
17761776 let replicas = setup_test_replicas_no_launch ( ) ;
17771777
17781778 // Set target as unhealthy
1779- replicas. targets [ 0 ] . health . toggle ( false ) ;
1779+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
17801780
17811781 // Ban with short timeout
17821782 replicas. targets [ 0 ]
@@ -1813,7 +1813,7 @@ fn test_ban_check_bans_unhealthy_replica_with_bad_lag() {
18131813 let replicas = setup_test_replicas_no_launch ( ) ;
18141814
18151815 // Set target as unhealthy
1816- replicas. targets [ 0 ] . health . toggle ( false ) ;
1816+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
18171817
18181818 // Set replica lag on the pool
18191819 replicas. targets [ 0 ] . pool . lock ( ) . replica_lag = ReplicaLag {
@@ -1842,7 +1842,7 @@ fn test_ban_check_bans_healthy_replica_with_bad_lag() {
18421842 let replicas = setup_test_replicas_no_launch ( ) ;
18431843
18441844 // Target stays healthy (default)
1845- assert ! ( replicas. targets[ 0 ] . health. healthy( ) ) ;
1845+ assert ! ( replicas. targets[ 0 ] . health( ) . healthy( ) ) ;
18461846
18471847 // Set replica lag on the pool
18481848 replicas. targets [ 0 ] . pool . lock ( ) . replica_lag = ReplicaLag {
@@ -1874,7 +1874,7 @@ fn test_ban_check_bans_with_pool_unhealthy_reason() {
18741874 let replicas = setup_test_replicas_no_launch ( ) ;
18751875
18761876 // Set target as unhealthy
1877- replicas. targets [ 0 ] . health . toggle ( false ) ;
1877+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
18781878
18791879 // No replica lag set (defaults to zero)
18801880
@@ -1908,7 +1908,7 @@ fn test_ban_check_does_not_ban_single_target() {
19081908 // Don't launch - we're unit testing ban_check
19091909
19101910 // Set target as unhealthy
1911- replicas. targets [ 0 ] . health . toggle ( false ) ;
1911+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
19121912
19131913 let monitor = Monitor :: new_test ( & replicas) ;
19141914 let threshold = ReplicaLag {
@@ -1973,7 +1973,7 @@ fn test_ban_check_does_not_ban_with_zero_ban_timeout() {
19731973 ) ;
19741974
19751975 // Set target as unhealthy
1976- replicas. targets [ 0 ] . health . toggle ( false ) ;
1976+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
19771977
19781978 let monitor = Monitor :: new_test ( & replicas) ;
19791979 let threshold = ReplicaLag {
@@ -2002,8 +2002,8 @@ fn test_ban_check_unbans_all_when_all_unhealthy() {
20022002 . ban ( Error :: ServerError , Duration :: from_secs ( 60 ) ) ;
20032003
20042004 // Set both as unhealthy
2005- replicas. targets [ 0 ] . health . toggle ( false ) ;
2006- replicas. targets [ 1 ] . health . toggle ( false ) ;
2005+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
2006+ replicas. targets [ 1 ] . health ( ) . toggle ( false ) ;
20072007
20082008 assert ! ( replicas. targets[ 0 ] . ban. banned( ) ) ;
20092009 assert ! ( replicas. targets[ 1 ] . ban. banned( ) ) ;
@@ -2043,8 +2043,8 @@ fn test_ban_check_unbans_all_when_all_healthy_but_banned() {
20432043 . ban
20442044 . ban ( Error :: ConnectTimeout , Duration :: from_secs ( 60 ) ) ;
20452045
2046- assert ! ( replicas. targets[ 0 ] . health. healthy( ) ) ;
2047- assert ! ( replicas. targets[ 1 ] . health. healthy( ) ) ;
2046+ assert ! ( replicas. targets[ 0 ] . health( ) . healthy( ) ) ;
2047+ assert ! ( replicas. targets[ 1 ] . health( ) . healthy( ) ) ;
20482048 assert ! ( replicas. targets[ 0 ] . ban. banned( ) ) ;
20492049 assert ! ( replicas. targets[ 1 ] . ban. banned( ) ) ;
20502050
@@ -2126,7 +2126,7 @@ fn test_ban_check_default_threshold_does_not_ban_healthy_replica_with_high_lag()
21262126 let replicas = setup_test_replicas_no_launch ( ) ;
21272127
21282128 // Target is healthy (default)
2129- assert ! ( replicas. targets[ 0 ] . health. healthy( ) ) ;
2129+ assert ! ( replicas. targets[ 0 ] . health( ) . healthy( ) ) ;
21302130
21312131 // Set very high replica lag on the pool
21322132 replicas. targets [ 0 ] . pool . lock ( ) . replica_lag = ReplicaLag {
@@ -2160,7 +2160,7 @@ fn test_ban_check_default_threshold_bans_unhealthy_with_pool_unhealthy_reason()
21602160 } ;
21612161
21622162 // Set target as unhealthy
2163- replicas. targets [ 0 ] . health . toggle ( false ) ;
2163+ replicas. targets [ 0 ] . health ( ) . toggle ( false ) ;
21642164
21652165 let monitor = Monitor :: new_test ( & replicas) ;
21662166 // Use default config thresholds (MAX values)
0 commit comments