Skip to content

Commit 3c55831

Browse files
authored
Bugfix: If unblock failed and all devices in a group were blocked, task would be added to queue and waiting for cron to unblock (#686)
…sk would be added to queue and wait corn to unblock <!-- Please provide brief information about the PR, what it contains & its purpose, new behaviors after the change. And let us know here if you need any help: https://github.com/microsoft/HydraLab/issues/new --> ## Description <!-- A few words to explain your changes --> ### Linked GitHub issue ID: # ## Pull Request Checklist <!-- Put an x in the boxes that apply. This is simply a reminder of what we are going to look for before merging your code. --> - [ ] Tests for the changes have been added (for bug fixes / features) - [x] Code compiles correctly with all tests are passed. - [x] I've read the [contributing guide](https://github.com/microsoft/HydraLab/blob/main/CONTRIBUTING.md#making-changes-to-the-code) and followed the recommended practices. - [ ] [Wikis](https://github.com/microsoft/HydraLab/wiki) or [README](https://github.com/microsoft/HydraLab/blob/main/README.md) have been reviewed and added / updated if needed (for bug fixes / features) ### Does this introduce a breaking change? *If this introduces a breaking change for Hydra Lab users, please describe the impact and migration path.* - [x] Yes - [ ] No ## How you tested it *Please make sure the change is tested, you can test it by adding UTs, do local test and share the screenshots, etc.* Please check the type of change your PR introduces: - [x] Bugfix - [ ] Feature - [ ] Technical design - [ ] Build related changes - [ ] Refactoring (no functional changes, no api changes) - [ ] Code style update (formatting, renaming) or Documentation content changes - [ ] Other (please describe): ### Feature UI screenshots or Technical design diagrams *If this is a relatively large or complex change, kick it off by drawing the tech design with PlantUML and explaining why you chose the solution you did and what alternatives you considered, etc...*
1 parent 2ca49d6 commit 3c55831

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

center/src/main/java/com/microsoft/hydralab/center/controller/TestTaskController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public Result<Object> runTestTask(@CurrentSecurityContext SysUser requestor,
9999
}
100100
testTaskService.checkTestTaskTeamConsistency(testTaskSpec);
101101
}
102+
// unblock frozen devices
103+
deviceAgentManagementService.unblockFrozenBlockedDevices();
102104
//if the queue is not empty, the task will be added to the queue directly
103105
if (testTaskService.isQueueEmpty()
104106
|| Task.RunnerType.APK_SCANNER.name().equals(testTaskSpec.runningType)

center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,6 @@ public List<AgentDeviceGroup> getAllAppiumAgents() {
707707

708708
public JSONObject runTestTaskBySpec(TestTaskSpec testTaskSpec) {
709709
JSONObject result;
710-
unblockFrozenBlockedDevices();
711710
if (Task.RunnerType.APPIUM_CROSS.name().equals(testTaskSpec.runningType)) {
712711
result = runAppiumTestTask(testTaskSpec);
713712
} else if (Task.RunnerType.T2C_JSON.name().equals(testTaskSpec.runningType)) {

center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public void runTask() {
101101
}
102102
isRunning.set(true);
103103

104+
// unblock frozen devices
105+
deviceAgentManagementService.unblockFrozenBlockedDevices();
104106
synchronized (taskQueue) {
105107
Iterator<TestTaskSpec> queueIterator = taskQueue.iterator();
106108
while (queueIterator.hasNext()) {

0 commit comments

Comments
 (0)