Skip to content

Commit

Permalink
Add lock to exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
Thevakumar-Luheerathan committed Dec 11, 2023
1 parent c20817c commit 2170c85
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/lang.'error as langError;
import ballerina/lang.runtime;

Expand All @@ -24,9 +23,12 @@ ConcurrentExecutionManager conMgr = new (1);

public function startSuite() returns int {
// exit if setTestOptions has failed
if exitCode > 0 {
return exitCode;
lock {
if exitCode > 0 {
return exitCode;
}
}

if listGroups {
string[] groupsList = groupStatusRegistry.getGroupsList();
if groupsList.length() == 0 {
Expand All @@ -38,7 +40,10 @@ public function startSuite() returns int {
} else {
if testRegistry.getFunctions().length() == 0 && testRegistry.getDependentFunctions().length() == 0 {
println("\tNo tests found");
return exitCode;
lock {
return exitCode;
}

}

error? err = orderTests();
Expand All @@ -56,7 +61,9 @@ public function startSuite() returns int {
reportGenerators.forEach(reportGen => reportGen(reportData));
}
}
return exitCode;
lock {
return exitCode;
}
}

function executeTests() returns error? {
Expand Down

0 comments on commit 2170c85

Please sign in to comment.