File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
src/main/java/org/utplsql/cli Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 13
13
import org .utplsql .api .reporter .Reporter ;
14
14
import org .utplsql .api .reporter .ReporterFactory ;
15
15
import org .utplsql .cli .exception .DatabaseConnectionFailed ;
16
+ import org .utplsql .cli .exception .ReporterTimeoutException ;
16
17
import org .utplsql .cli .log .StringBlockFormatter ;
17
18
18
19
import javax .sql .DataSource ;
@@ -201,19 +202,21 @@ public int run() {
201
202
getReporterManager ().startReporterGatherers (executorService , dataSource , returnCode );
202
203
203
204
executorService .shutdown ();
204
- executorService .awaitTermination (timeoutInMinutes , TimeUnit .MINUTES );
205
+ if ( !executorService .awaitTermination (timeoutInMinutes , TimeUnit .MINUTES ) ) {
206
+ throw new ReporterTimeoutException (timeoutInMinutes );
207
+ }
205
208
206
209
logger .info ("--------------------------------------" );
207
210
logger .info ("All tests done." );
208
211
209
212
return returnCode [0 ];
210
213
}
211
- catch ( DatabaseNotCompatibleException | UtPLSQLNotInstalledException | DatabaseConnectionFailed e ) {
214
+ catch ( DatabaseNotCompatibleException | UtPLSQLNotInstalledException | DatabaseConnectionFailed | ReporterTimeoutException e ) {
212
215
System .out .println (e .getMessage ());
213
216
} catch (Exception e ) {
214
217
e .printStackTrace ();
215
218
}
216
- return 1 ;
219
+ return Cli . DEFAULT_ERROR_CODE ;
217
220
}
218
221
219
222
private ArrayList <String > getObjectList (String includeObjects ) {
Original file line number Diff line number Diff line change
1
+ package org .utplsql .cli .exception ;
2
+
3
+ public class ReporterTimeoutException extends Exception {
4
+
5
+ private final int timeOutInMinutes ;
6
+
7
+ public ReporterTimeoutException ( int timeoutInMinutes ) {
8
+ super ("Timeout while waiting for reporters to finish for " + timeoutInMinutes + " minutes" );
9
+ this .timeOutInMinutes = timeoutInMinutes ;
10
+ }
11
+
12
+ public int getTimeOutInMinutes () {
13
+ return timeOutInMinutes ;
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments