Skip to content

Commit dbeae27

Browse files
committed
Reduce build time by reducing shutdown wait period for Jetty tests
1 parent fb312d0 commit dbeae27

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap

spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/JettyHttpServer.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626

2727
/**
2828
* @author Rossen Stoyanchev
29+
* @author Sam Brannen
2930
*/
3031
public class JettyHttpServer extends AbstractHttpServer {
3132

@@ -73,7 +74,10 @@ protected void stopInternal() throws Exception {
7374
finally {
7475
try {
7576
if (this.jettyServer.isRunning()) {
76-
this.jettyServer.setStopTimeout(5000);
77+
// Do not configure a large stop timeout. For example, setting a stop timeout
78+
// of 5000 adds an additional 1-2 seconds to the runtime of each test using
79+
// the Jetty sever, resulting in 2-4 extra minutes of overall build time.
80+
this.jettyServer.setStopTimeout(100);
7781
this.jettyServer.stop();
7882
this.jettyServer.destroy();
7983
}
@@ -88,7 +92,10 @@ protected void stopInternal() throws Exception {
8892
protected void resetInternal() {
8993
try {
9094
if (this.jettyServer.isRunning()) {
91-
this.jettyServer.setStopTimeout(5000);
95+
// Do not configure a large stop timeout. For example, setting a stop timeout
96+
// of 5000 adds an additional 1-2 seconds to the runtime of each test using
97+
// the Jetty sever, resulting in 2-4 extra minutes of overall build time.
98+
this.jettyServer.setStopTimeout(100);
9299
this.jettyServer.stop();
93100
this.jettyServer.destroy();
94101
}

0 commit comments

Comments
 (0)