-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
135831: roachtest: add groups to task manager r=DarrylWong a=herkolategan Previously, a new API for managing tasks were introduced (see #133263). However, this did not address roachtests that want to manage groups. In an effort to replace `errgroup`, and `monitor.Go` for task management, this change introduces a group provider in the task manager. A group adds the ability to wait on a subset of tasks to finish before proceeding. The task handler will still report returned errors or panics to the test framework. Informs: #118214 Epic: None Release note: None Co-authored-by: Herko Lategan <[email protected]>
- Loading branch information
Showing
10 changed files
with
266 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
pkg/cmd/roachtest/clusterstats/mock_test_generated_test.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the CockroachDB Software License | ||
// included in the /LICENSE file. | ||
|
||
package task | ||
|
||
// Group is an interface for managing a group of tasks. It is intended for use | ||
// in roachtests, for creating a group and waiting for all tasks in the group to | ||
// complete. | ||
type Group interface { | ||
Tasker | ||
// Wait waits for all tasks in the group to complete. Errors from tasks are reported to the | ||
// test framework automatically and will cause the test to fail, which also | ||
// cancels the context passed to the group. | ||
Wait() | ||
} | ||
|
||
// GroupProvider is an interface for creating new Group(s). Generally, the test | ||
// framework will supply a GroupProvider to tests. | ||
type GroupProvider interface { | ||
// NewGroup creates a new Group to manage tasks. Any options passed to this | ||
// function will be applied to all tasks started by the group. | ||
NewGroup(opts ...Option) Group | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.