Skip to content

Commit

Permalink
[scheduler] Increment task attempts and reset status on reruns (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
Casey Hillers committed Mar 10, 2022
1 parent a826a73 commit 4bd47fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app_dart/lib/src/service/luci_build_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ class LuciBuildService {
],
);
await pubsub.publish('scheduler-requests', request);

task.attempts = (task.attempts ?? 0) + 1;
task.status = Task.statusNew;
await datastore.insert(<Task>[task]);

return true;
}

Expand Down
4 changes: 4 additions & 0 deletions app_dart/test/service/luci_build_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ void main() {
buildNumber: 1,
);
final Target target = generateTarget(1);
expect(task.attempts, 1);
expect(task.status, Task.statusFailed);
final bool rerunFlag = await service.checkRerunBuilder(
commit: totCommit,
task: task,
Expand All @@ -553,6 +555,8 @@ void main() {
}
expect(scheduleBuildRequest.gitilesCommit?.project, 'mirrors/engine');
expect(rerunFlag, isTrue);
expect(task.attempts, 2);
expect(task.status, Task.statusNew);
});

test('Rerun a test failed builder', () async {
Expand Down

0 comments on commit 4bd47fb

Please sign in to comment.