Merge pull request #96906 from Rajalakshmi-Girish/issue-96853

Fixes the unit tests to be more tolerant with error messages
This commit is contained in:
Kubernetes Prow Robot
2021-01-05 17:09:51 -08:00
committed by GitHub
3 changed files with 7 additions and 6 deletions

View File

@@ -227,8 +227,8 @@ func TestCheckpointStateRestore(t *testing.T) {
restoredState, err := NewCheckpointState(testingDir, testingCheckpoint, tc.policyName, tc.initialContainers)
if err != nil {
if strings.TrimSpace(tc.expectedError) != "" {
tc.expectedError = "could not restore state from checkpoint: " + tc.expectedError
if strings.HasPrefix(err.Error(), tc.expectedError) {
if strings.Contains(err.Error(), "could not restore state from checkpoint") &&
strings.Contains(err.Error(), tc.expectedError) {
t.Logf("got expected error: %v", err)
return
}