@@ -222,8 +222,10 @@ func TestRouter_DeploymentsWithErrorsDoNotUpdateService(t *testing.T) {
222222 serviceOptions := defaultServiceOptions
223223 serviceOptions .Hosts = []string {"example.com" }
224224
225+ targetOptions := defaultTargetOptions
226+
225227 assert .NoFileExists (t , router .statePath )
226- require .NoError (t , router .DeployService ("service1" , []string {target }, defaultEmptyReaders , serviceOptions , defaultTargetOptions , DefaultDeployTimeout , DefaultDrainTimeout ))
228+ require .NoError (t , router .DeployService ("service1" , []string {target }, defaultEmptyReaders , serviceOptions , targetOptions , DefaultDeployTimeout , DefaultDrainTimeout ))
227229 ensureServiceIsHealthy ()
228230 require .FileExists (t , router .statePath )
229231
@@ -239,23 +241,30 @@ func TestRouter_DeploymentsWithErrorsDoNotUpdateService(t *testing.T) {
239241 sm .Set (service )
240242 }
241243 persistedOptions := sm .Get ("service1" ).options
244+ persistedTargetOptions := sm .Get ("service1" ).targetOptions
245+
242246 assert .Equal (t , serviceOptions .TLSPrivateKeyPath , persistedOptions .TLSPrivateKeyPath )
243247 assert .Equal (t , serviceOptions .TLSCertificatePath , persistedOptions .TLSCertificatePath )
244248 assert .Equal (t , serviceOptions .TLSEnabled , persistedOptions .TLSEnabled )
245249 assert .Equal (t , serviceOptions .ErrorPagePath , persistedOptions .ErrorPagePath )
250+ assert .Equal (t , targetOptions .BufferRequests , persistedTargetOptions .BufferRequests )
246251 }
247252
248253 t .Run ("custom TLS that is not valid" , func (t * testing.T ) {
249254 newServiceOptions := ServiceOptions {TLSEnabled : true , TLSCertificatePath : "not valid" , TLSPrivateKeyPath : "not valid" }
250- require .Error (t , router .DeployService ("service1" , []string {target }, defaultEmptyReaders , newServiceOptions , defaultTargetOptions , DefaultDeployTimeout , DefaultDrainTimeout ))
255+ newTargetOptions := TargetOptions {BufferRequests : true , HealthCheckConfig : defaultHealthCheckConfig }
256+
257+ require .Error (t , router .DeployService ("service1" , []string {target }, defaultEmptyReaders , newServiceOptions , newTargetOptions , DefaultDeployTimeout , DefaultDrainTimeout ))
251258
252259 ensureServiceIsHealthy ()
253260 ensureStateWasNotSaved ()
254261 })
255262
256263 t .Run ("custom error pages that are not valid" , func (t * testing.T ) {
257264 newServiceOptions := ServiceOptions {ErrorPagePath : "not valid" }
258- require .Error (t , router .DeployService ("service1" , []string {target }, defaultEmptyReaders , newServiceOptions , defaultTargetOptions , DefaultDeployTimeout , DefaultDrainTimeout ))
265+ newTargetOptions := TargetOptions {BufferRequests : true , HealthCheckConfig : defaultHealthCheckConfig }
266+
267+ require .Error (t , router .DeployService ("service1" , []string {target }, defaultEmptyReaders , newServiceOptions , newTargetOptions , DefaultDeployTimeout , DefaultDrainTimeout ))
259268
260269 ensureServiceIsHealthy ()
261270 ensureStateWasNotSaved ()
0 commit comments