Skip to content
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

chore: increase GcpNfsVolume ready timeout . #23

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions internal/valueAssert.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,31 @@ func eventuallyValueAssertEqualsNoOptions(ctx context.Context, a string, b strin

func eventuallyValueAssertEqualsWithOptions(ctx context.Context, a string, b string, withOpts string) error {
timeout := DefaultEventuallyTimeout
opts := strings.Split(withOpts, ",")
for _, opt := range opts {
opt = strings.TrimSpace(opt)
// ugly, but for now with just few timeout1-5X works, if you add more, try to find a better implementation
switch opt {
case "timeout2X":
timeout = 2 * timeout
case "timeout3X":
timeout = 3 * timeout
case "timeout4X":
timeout = 4 * timeout
case "timeout5X":
timeout = 5 * timeout
default:
return fmt.Errorf("unknown option: %s", opt)

withOpts = strings.TrimSpace(withOpts)
if len(withOpts) > 0 {
opts := strings.Split(withOpts, ",")
for _, opt := range opts {
opt = strings.TrimSpace(opt)
if opt == "" {
continue
}
// ugly, but for now with just few timeout1-5X works, if you add more, try to find a better implementation
switch opt {
case "timeout2X":
timeout = 2 * timeout
case "timeout3X":
timeout = 3 * timeout
case "timeout4X":
timeout = 4 * timeout
case "timeout5X":
timeout = 5 * timeout
default:
return fmt.Errorf("unknown option: %s", opt)
}
}
}

var errMsg string
gm := gomega.NewGomega(func(message string, callerSkip ...int) {
errMsg = message
Expand Down
Loading