8000 make getTotalNumberOfCompletedTests more robust · lipsa178/utPLSQL-SQLDeveloper@bfe8f19 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfe8f19

Browse files
make getTotalNumberOfCompletedTests more robust
1 parent 5ca644e commit bfe8f19

File tree

1 file changed

+7
-1
lines changed
  • sqldev/src/main/java/org/utplsql/sqldev/model/runner

1 file changed

+7
-1
lines changed

sqldev/src/main/java/org/utplsql/sqldev/model/runner/Run.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ public int getTotalNumberOfCompletedTests() {
103103
|| counter.getError() == null) {
104104
return -1;
105105
}
106-
return counter.getDisabled() + counter.getSuccess() + counter.getFailure() + counter.getError();
106+
int total = counter.getDisabled() + counter.getSuccess() + counter.getFailure() + counter.getError();
107+
if (totalNumberOfTests != null && total > totalNumberOfTests) {
108+
// can happen when run is cancelled and two processes are updating the run in parallel
109+
// not worth to ensure consistency for this case, using synchronized will not be enough
110+
total = totalNumberOfTests;
111+
}
112+
return total;
107113
}
108114

109115
public String getReporterId() {

0 commit comments

Comments
 (0)
0