mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
test no longer fails when it fails to get the summary
This commit is contained in:
parent
84d0fbdb2e
commit
5d352439d4
@ -146,7 +146,9 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
|
||||
It(fmt.Sprintf("should eventually see %s, and then evict all of the correct pods", testCondition), func() {
|
||||
Eventually(func() error {
|
||||
hasPressure, err := hasPressureCondition(f, testCondition)
|
||||
framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if hasPressure {
|
||||
return nil
|
||||
}
|
||||
@ -161,7 +163,9 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
|
||||
framework.Logf("fetching pod %s; phase= %v", p.Name, p.Status.Phase)
|
||||
}
|
||||
_, err = hasPressureCondition(f, testCondition)
|
||||
framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
By("checking eviction ordering and ensuring important pods dont fail")
|
||||
done := true
|
||||
@ -216,7 +220,9 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
|
||||
By("making sure conditions eventually return to normal")
|
||||
Eventually(func() error {
|
||||
hasPressure, err := hasPressureCondition(f, testCondition)
|
||||
framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if hasPressure {
|
||||
return fmt.Errorf("Conditions havent returned to normal, we still have %s", testCondition)
|
||||
}
|
||||
@ -226,7 +232,12 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs
|
||||
By("making sure conditions do not return")
|
||||
Consistently(func() error {
|
||||
hasPressure, err := hasPressureCondition(f, testCondition)
|
||||
framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition))
|
||||
if err != nil {
|
||||
// Race conditions sometimes occur when checking pressure condition due to #38710 (Docker bug)
|
||||
// Do not fail the test when this occurs, since this is expected to happen occasionally.
|
||||
framework.Logf("Failed to check pressure condition. Error: %v", err)
|
||||
return nil
|
||||
}
|
||||
if hasPressure {
|
||||
return fmt.Errorf("%s dissappeared and then reappeared", testCondition)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user