Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scheduler] Increment task attempts and reset status on reruns #1656

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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