test: reduce wait time for mds standby test
The mds standby test was timing out after six seconds on three different attempts, causing a single unit test to take almost 20 seconds. Now we reduce the wait time to a total of three seconds. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
3 files changed
+6
-7
No files matched your search
@@ -362,8 +362,8 @@ func deleteFSPool(context *clusterd.Context, clusterInfo *ClusterInfo, poolNames
|
||||
}
|
||||
|
||||
// WaitForNoStandbys waits for all standbys go away
|
||||
func WaitForNoStandbys(context *clusterd.Context, clusterInfo *ClusterInfo, timeout time.Duration) error {
|
||||
err := wait.PollUntilContextTimeout(clusterInfo.Context, 3*time.Second, timeout, true, func(ctx ctx.Context) (bool, error) {
|
||||
func WaitForNoStandbys(context *clusterd.Context, clusterInfo *ClusterInfo, retryInterval, timeout time.Duration) error {
|
||||
err := wait.PollUntilContextTimeout(clusterInfo.Context, retryInterval, timeout, true, func(ctx ctx.Context) (bool, error) {
|
||||
mdsDump, err := GetMDSDump(context, clusterInfo)
|
||||
if err != nil {
|
||||
logger.Errorf("failed to get fs dump. %v", err)
|
||||
|
||||
@@ -542,7 +542,7 @@ func TestWaitForNoStandbys(t *testing.T) {
|
||||
return "", errors.Errorf("unexpected ceph command %q", args)
|
||||
}
|
||||
|
||||
err := WaitForNoStandbys(context, AdminTestClusterInfo("mycluster"), 6*time.Second)
|
||||
err := WaitForNoStandbys(context, AdminTestClusterInfo("mycluster"), time.Millisecond, 5*time.Millisecond)
|
||||
assert.Error(t, err)
|
||||
|
||||
executor.MockExecuteCommandWithOutput = func(command string, args ...string) (string, error) {
|
||||
@@ -555,7 +555,7 @@ func TestWaitForNoStandbys(t *testing.T) {
|
||||
return "", errors.Errorf("unexpected ceph command %q", args)
|
||||
}
|
||||
|
||||
err = WaitForNoStandbys(context, AdminTestClusterInfo("mycluster"), 6*time.Second)
|
||||
err = WaitForNoStandbys(context, AdminTestClusterInfo("mycluster"), time.Millisecond, 5*time.Millisecond)
|
||||
assert.Error(t, err)
|
||||
|
||||
firstCall := true
|
||||
@@ -582,9 +582,8 @@ func TestWaitForNoStandbys(t *testing.T) {
|
||||
}
|
||||
return "", errors.Errorf("unexpected ceph command %q", args)
|
||||
}
|
||||
err = WaitForNoStandbys(context, AdminTestClusterInfo("mycluster"), 6*time.Second)
|
||||
err = WaitForNoStandbys(context, AdminTestClusterInfo("mycluster"), time.Millisecond, 5*time.Millisecond)
|
||||
assert.NoError(t, err)
|
||||
|
||||
}
|
||||
|
||||
func TestListSubvolumeGroups(t *testing.T) {
|
||||
|
||||
@@ -290,7 +290,7 @@ func (c *Cluster) upgradeMDS() error {
|
||||
return errors.Wrap(err, "failed to scale down deployments during upgrade")
|
||||
}
|
||||
logger.Debugf("waiting for all standbys gone")
|
||||
if err := cephclient.WaitForNoStandbys(c.context, c.clusterInfo, 120*time.Second); err != nil {
|
||||
if err := cephclient.WaitForNoStandbys(c.context, c.clusterInfo, 3*time.Second, 120*time.Second); err != nil {
|
||||
return errors.Wrap(err, "failed to wait for stopping all standbys")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user