-
Notifications
You must be signed in to change notification settings - Fork 4
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
Kind multi-cluster envtests #40
Kind multi-cluster envtests #40
Conversation
31ff107
to
d64219a
Compare
8d494c3
to
13b1b74
Compare
13b1b74
to
cc27de4
Compare
Straighten out contexts. Addtnl error handling. Spawn kind clusters in parallel. Fix variable capture, try to get teardown working. Parallel cleanup. Make number of nodes per k8s cluster configurable, drop nodes to 1 per cluster for registration test.
cc27de4
to
5c3e445
Compare
// This relies on a controller that is not running in the envtest. | ||
res := ex.RegisterCluster() | ||
return res == nil | ||
}, time.Second*300, time.Second*1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.
} | ||
} | ||
return err1 == nil && err2 == nil | ||
}, time.Second*60, time.Second*2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.
require.Eventually(func() bool { | ||
err := client1.Get(ctx, types.NamespacedName{Name: "k8ssandra-operator-secret", Namespace: "source-namespace"}, sourceSecret) | ||
return err == nil | ||
}, time.Second*60, time.Second*5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.
@@ -127,15 +111,14 @@ func TestRegister(t *testing.T) { | |||
return false | |||
} | |||
return err == nil | |||
}, time.Second*6, time.Millisecond*100) | |||
|
|||
}, time.Second*60, time.Second*2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.
) | ||
|
||
func TestMain(m *testing.M) { | ||
// metrics.DefaultBindAddress = "0" This no longer appears to exist... | ||
os.Exit(envtest.RunMulti(m, func(e *envtest.MultiK8sEnvironment) { | ||
testDir, err = os.MkdirTemp("", "k8ssandra-operator-test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: This isn't k8ssandra-operator..
Adds multi-cluster envtests using kind as a backend.
Fixes: #41