Skip to content

Conversation

@CaseyHillers
Copy link
Contributor

@CaseyHillers CaseyHillers commented Apr 22, 2022

flutter/flutter#100793

This implements a cron job that looks at task columns, and backfills them. It will only run a max of one task per column at a given time.

This is needed to migrate the devicelab tests over to the cocoon scheduler.

@CaseyHillers CaseyHillers marked this pull request as ready for review April 25, 2022 15:21
///
/// Relies on the GitHub Checks API being enabled for this repo.
static Set<RepositorySlug> supportedRepos = <RepositorySlug>{
Set<RepositorySlug> supportedRepos = <RepositorySlug>{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needed to be changed so tests could override it. Otherwise, the data would look weird where there would be 6 backfills instead of 1 (1 for each supported repo)

return null;
}

final List<FullTask> backfillTask =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to use this logic to rerun failed tests to surface flakes. Not needed in this PR though.

late FakePubSub pubsub;
late FakeScheduler scheduler;

group('BatchBackfiller', () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add tests for batch scheduling cases: more than 1 target are scheduled when they all need to schedule; only one target is scheduled when itself needs to schedule, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good point on having multiple columns being tested at a time.

To clarify, I added tests for when:

  1. Only one column needs to be backfilled
  2. 2 columns need to be backfilled


- description: backfills builds
url: /api/scheduler/batch-backfiller
schedule: every 5 minutes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a no-op for LUCI triggered builders?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Those targets have a OmitPolicy which means Cocoon doesn't do anything.

Copy link
Contributor

@keyonghan keyonghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CaseyHillers CaseyHillers added the autosubmit Merge PR when tree becomes green via auto submit App. label Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants