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 1313import org .utplsql .api .reporter .Reporter ;
1414import org .utplsql .api .reporter .ReporterFactory ;
1515import org .utplsql .cli .exception .DatabaseConnectionFailed ;
16+ import org .utplsql .cli .exception .ReporterTimeoutException ;
1617import org .utplsql .cli .log .StringBlockFormatter ;
1718
1819import javax .sql .DataSource ;
@@ -201,19 +202,21 @@ public int run() {
201202 getReporterManager ().startReporterGatherers (executorService , dataSource , returnCode );
202203
203204 executorService .shutdown ();
204- executorService .awaitTermination (timeoutInMinutes , TimeUnit .MINUTES );
205+ if ( !executorService .awaitTermination (timeoutInMinutes , TimeUnit .MINUTES ) ) {
206+ throw new ReporterTimeoutException (timeoutInMinutes );
207+ }
205208
206209 logger .info ("--------------------------------------" );
207210 logger .info ("All tests done." );
208211
209212 return returnCode [0 ];
210213 }
211- catch ( DatabaseNotCompatibleException | UtPLSQLNotInstalledException | DatabaseConnectionFailed e ) {
214+ catch ( DatabaseNotCompatibleException | UtPLSQLNotInstalledException | DatabaseConnectionFailed | ReporterTimeoutException e ) {
212215 System .out .println (e .getMessage ());
213216 } catch (Exception e ) {
214217 e .printStackTrace ();
215218 }
216- return 1 ;
219+ return Cli . DEFAULT_ERROR_CODE ;
217220 }
218221
219222 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