@@ -25,13 +25,13 @@ fn download_crate_with_broken_networking_primary_database() {
25
25
// do an unconditional redirect to the CDN, without checking whether the crate exists or what
26
26
// the exact capitalization of crate name is.
27
27
28
- app. primary_db_chaosproxy ( ) . break_networking ( ) ;
28
+ app. primary_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
29
29
assert_unconditional_redirects ( & anon) ;
30
30
31
31
// After restoring the network and waiting for the database pool to get healthy again redirects
32
32
// should be checked again.
33
33
34
- app. primary_db_chaosproxy ( ) . restore_networking ( ) ;
34
+ app. primary_db_chaosproxy ( ) . restore_networking ( ) . unwrap ( ) ;
35
35
app. as_inner ( )
36
36
. primary_database
37
37
. wait_until_healthy ( DB_HEALTHY_TIMEOUT )
@@ -75,12 +75,12 @@ fn http_error_with_unhealthy_database() {
75
75
let response = anon. get :: < ( ) > ( "/api/v1/summary" ) ;
76
76
assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
77
77
78
- app. primary_db_chaosproxy ( ) . break_networking ( ) ;
78
+ app. primary_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
79
79
80
80
let response = anon. get :: < ( ) > ( "/api/v1/summary" ) ;
81
81
assert_eq ! ( response. status( ) , StatusCode :: SERVICE_UNAVAILABLE ) ;
82
82
83
- app. primary_db_chaosproxy ( ) . restore_networking ( ) ;
83
+ app. primary_db_chaosproxy ( ) . restore_networking ( ) . unwrap ( ) ;
84
84
app. as_inner ( )
85
85
. primary_database
86
86
. wait_until_healthy ( DB_HEALTHY_TIMEOUT )
@@ -99,14 +99,14 @@ fn fallback_to_replica_returns_user_info() {
99
99
. with_chaos_proxy ( )
100
100
. with_user ( ) ;
101
101
app. db_new_user ( "foo" ) ;
102
- app. primary_db_chaosproxy ( ) . break_networking ( ) ;
102
+ app. primary_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
103
103
104
104
// When the primary database is down, requests are forwarded to the replica database
105
105
let response = owner. get :: < ( ) > ( URL ) ;
106
106
assert_eq ! ( response. status( ) , 200 ) ;
107
107
108
108
// restore primary database connection
109
- app. primary_db_chaosproxy ( ) . restore_networking ( ) ;
109
+ app. primary_db_chaosproxy ( ) . restore_networking ( ) . unwrap ( ) ;
110
110
app. as_inner ( )
111
111
. primary_database
112
112
. wait_until_healthy ( DB_HEALTHY_TIMEOUT )
@@ -122,15 +122,15 @@ fn restored_replica_returns_user_info() {
122
122
. with_chaos_proxy ( )
123
123
. with_user ( ) ;
124
124
app. db_new_user ( "foo" ) ;
125
- app. primary_db_chaosproxy ( ) . break_networking ( ) ;
126
- app. replica_db_chaosproxy ( ) . break_networking ( ) ;
125
+ app. primary_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
126
+ app. replica_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
127
127
128
128
// When both primary and replica database are down, the request returns an error
129
129
let response = owner. get :: < ( ) > ( URL ) ;
130
130
assert_eq ! ( response. status( ) , StatusCode :: SERVICE_UNAVAILABLE ) ;
131
131
132
132
// Once the replica database is restored, it should serve as a fallback again
133
- app. replica_db_chaosproxy ( ) . restore_networking ( ) ;
133
+ app. replica_db_chaosproxy ( ) . restore_networking ( ) . unwrap ( ) ;
134
134
app. as_inner ( )
135
135
. read_only_replica_database
136
136
. as_ref ( )
@@ -142,7 +142,7 @@ fn restored_replica_returns_user_info() {
142
142
assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
143
143
144
144
// restore connection
145
- app. primary_db_chaosproxy ( ) . restore_networking ( ) ;
145
+ app. primary_db_chaosproxy ( ) . restore_networking ( ) . unwrap ( ) ;
146
146
app. as_inner ( )
147
147
. primary_database
148
148
. wait_until_healthy ( DB_HEALTHY_TIMEOUT )
@@ -158,15 +158,15 @@ fn restored_primary_returns_user_info() {
158
158
. with_chaos_proxy ( )
159
159
. with_user ( ) ;
160
160
app. db_new_user ( "foo" ) ;
161
- app. primary_db_chaosproxy ( ) . break_networking ( ) ;
162
- app. replica_db_chaosproxy ( ) . break_networking ( ) ;
161
+ app. primary_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
162
+ app. replica_db_chaosproxy ( ) . break_networking ( ) . unwrap ( ) ;
163
163
164
164
// When both primary and replica database are down, the request returns an error
165
165
let response = owner. get :: < ( ) > ( URL ) ;
166
166
assert_eq ! ( response. status( ) , StatusCode :: SERVICE_UNAVAILABLE ) ;
167
167
168
168
// Once the replica database is restored, it should serve as a fallback again
169
- app. primary_db_chaosproxy ( ) . restore_networking ( ) ;
169
+ app. primary_db_chaosproxy ( ) . restore_networking ( ) . unwrap ( ) ;
170
170
app. as_inner ( )
171
171
. primary_database
172
172
. wait_until_healthy ( DB_HEALTHY_TIMEOUT )
0 commit comments