mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
test: Remove use of "mitchellh/go-testing-interface" for stdlib. (#25640)
The stdlib testing package now includes this interface, so we can remove our dependency on the external library.
This commit is contained in:
@@ -4,19 +4,19 @@
|
||||
package tasklifecycle
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/nomad/nomad/structs"
|
||||
"github.com/hashicorp/nomad/testutil"
|
||||
testing "github.com/mitchellh/go-testing-interface"
|
||||
)
|
||||
|
||||
func RequireTaskBlocked(t testing.T, c *Coordinator, task *structs.Task) {
|
||||
func RequireTaskBlocked(t testing.TB, c *Coordinator, task *structs.Task) {
|
||||
ch := c.StartConditionForTask(task)
|
||||
requireChannelBlocking(t, ch, task.Name)
|
||||
}
|
||||
|
||||
func RequireTaskAllowed(t testing.T, c *Coordinator, task *structs.Task) {
|
||||
func RequireTaskAllowed(t testing.TB, c *Coordinator, task *structs.Task) {
|
||||
ch := c.StartConditionForTask(task)
|
||||
requireChannelPassing(t, ch, task.Name)
|
||||
}
|
||||
@@ -33,7 +33,7 @@ func WaitNotInitUntil(c *Coordinator, until time.Duration, errorFunc func()) {
|
||||
})
|
||||
}
|
||||
|
||||
func requireChannelPassing(t testing.T, ch <-chan struct{}, name string) {
|
||||
func requireChannelPassing(t testing.TB, ch <-chan struct{}, name string) {
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
return !isChannelBlocking(ch), nil
|
||||
}, func(_ error) {
|
||||
@@ -41,7 +41,7 @@ func requireChannelPassing(t testing.T, ch <-chan struct{}, name string) {
|
||||
})
|
||||
}
|
||||
|
||||
func requireChannelBlocking(t testing.T, ch <-chan struct{}, name string) {
|
||||
func requireChannelBlocking(t testing.TB, ch <-chan struct{}, name string) {
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
return isChannelBlocking(ch), nil
|
||||
}, func(_ error) {
|
||||
|
||||
Reference in New Issue
Block a user