Skip to content

Commit

Permalink
Add waiting logic for created strands
Browse files Browse the repository at this point in the history
  • Loading branch information
chiranSachintha committed Jan 22, 2025
1 parent a4b67fe commit 68f615e
Showing 1 changed file with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,25 +207,37 @@ isolated class ExecutionManager {
}

isolated function populateExecutionQueues() {
int i = 0;
TestCompletionStatus executionCompletionStatus = YET_TO_COMPLETE;
int testCount = 0;
lock {
int i = 0;
TestCompletionStatus executionCompletionStatus = YET_TO_COMPLETE;
while i < self.testsInExecution.length() {
testCount = self.testsInExecution.length();
}
while i < testCount {
TestFunctionMetaData? inProgressTestMetaData = ();
lock {
TestFunction testInProgress = self.testsInExecution[i];
TestFunctionMetaData? inProgressTestMetaData = self.testMetaData[testInProgress.name];
if inProgressTestMetaData == () {
continue;
}
executionCompletionStatus = inProgressTestMetaData.executionCompletionStatus;
if executionCompletionStatus == COMPLETED {
inProgressTestMetaData.dependents.reverse().forEach(
inProgressTestMetaData = self.testMetaData[testInProgress.name].cloneReadOnly();
}
if inProgressTestMetaData == () {
i += 1;
continue;
}
executionCompletionStatus = inProgressTestMetaData.executionCompletionStatus;
if executionCompletionStatus == COMPLETED {
inProgressTestMetaData.dependents.reverse().forEach(
dependent => self.checkExecutionReadiness(dependent));
lock {
_ = self.testsInExecution.remove(i);
} else if executionCompletionStatus == SUSPENDED {
testCount = self.testsInExecution.length();
}
} else if executionCompletionStatus == SUSPENDED {
lock {
_ = self.testsInExecution.remove(i);
} else {
i += 1;
testCount = self.testsInExecution.length();
}
} else {
i += 1;
}
}
}
Expand Down

0 comments on commit 68f615e

Please sign in to comment.