-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix switchover schedule tests #2995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
446c134
1954925
1d8ab8b
53ee08d
0b9df9d
8f53b66
c0c0367
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2116,7 +2116,7 @@ func TestCompareVolumeMounts(t *testing.T) { | |
| } | ||
|
|
||
| func TestGetSwitchoverSchedule(t *testing.T) { | ||
| now := time.Now() | ||
| now, _ := time.Parse(time.RFC3339, "2025-11-11T12:35:00Z") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note that you can reproduce the test failures I had when running locally by passing in some other times here like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jup, could reproduce. Thanks for the pointer |
||
|
|
||
| futureTimeStart := now.Add(1 * time.Hour) | ||
| futureWindowTimeStart := futureTimeStart.Format("15:04") | ||
|
|
@@ -2195,7 +2195,7 @@ func TestGetSwitchoverSchedule(t *testing.T) { | |
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| cluster.Spec.MaintenanceWindows = tt.windows | ||
| schedule := cluster.GetSwitchoverSchedule() | ||
| schedule := cluster.GetSwitchoverScheduleAtTime(now) | ||
FxKu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if schedule != tt.expected { | ||
| t.Errorf("Expected GetSwitchoverSchedule to return %s, returned: %s", tt.expected, schedule) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.