mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 15:50:10 +00:00
fix test for CheckpointStateRestore
This commit is contained in:
parent
7380fc735a
commit
a64b9cee21
@ -225,15 +225,19 @@ func TestCheckpointStateRestore(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restoredState, err := NewCheckpointState(testingDir, testingCheckpoint, tc.policyName, tc.initialContainers)
|
restoredState, err := NewCheckpointState(testingDir, testingCheckpoint, tc.policyName, tc.initialContainers)
|
||||||
if err != nil {
|
if strings.TrimSpace(tc.expectedError) == "" {
|
||||||
if strings.TrimSpace(tc.expectedError) != "" {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "could not restore state from checkpoint") &&
|
t.Fatalf("unexpected error while creating checkpointState: %v", err)
|
||||||
strings.Contains(err.Error(), tc.expectedError) {
|
}
|
||||||
t.Logf("got expected error: %v", err)
|
} else {
|
||||||
return
|
if err == nil {
|
||||||
}
|
t.Fatalf("expected error: %s, got nil", 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
|
||||||
}
|
}
|
||||||
t.Fatalf("unexpected error while creatng checkpointState: %v", err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// compare state after restoration with the one expected
|
// compare state after restoration with the one expected
|
||||||
|
Loading…
Reference in New Issue
Block a user