-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
Timeout on setup nodes in ginkgo v2 #882
Comments
Hi @mgoerens. My guess (which may be corrected by @onsi later) is that this relates to the removal of async tests, with the recommendation to use async assertions instead: https://onsi.github.io/ginkgo/MIGRATING_TO_V2#removed-async-testing |
That's right @blgm - @mgoerens please take a look at the section of the migration doc George linked to. There's also a deeper dive into async testing patterns in the documentation here. If you run into issues let us know and we can help further. In fact if you can point me at your code (if it's open source) i can make some concrete suggestions on how to migrate things beyond the simple first-pass shared in the migration doc. |
Thanks a lot for your answers. I had another look at the docs. Of course, the reality is a bit more complex than my very simple code snippet :) I'm using Note that this is for integration tests, and it starts a test environment using I'm not a developer of The actual line which is likely to hang is probably |
hey @mgoerens will reply more when i'm at my computer. for now just wanted to let you know that github link 404s. any chance you have a public repo i can look at? |
Right, forgot this was still private. I set the visibility of the repository to public now, as it should be. |
Thanks for opening the repo up. It looks like the original code you've linked to wasn't doing what folks expect. In Ginkgo V1 the timeout only applies if the function passed to So, you can just drop the 60 and move on. In fact, I dug in a bit deeper and it looks like If you do want to wrap your own timeout around var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
var cfg *rest.Config
var err error
done := make(chan interface{}, 0)
go func() {
defer GinkgoRecover()
cfg, err = testEnv.Start()
close(done)
}()
Eventually(done).WithTimeout(time.Minute).Should(BeClosed())
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
err = synapsev1alpha1.AddToScheme(scheme.Scheme)
Expect(err).NotTo(HaveOccurred())
//+kubebuilder:scaffold:scheme
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
}) |
Great infos, thanks a lot ! There's nothing else to add I think :) |
* Bumping ginkgo to v2 and adding codecov github action * Generating coverage in e2e test * Fixing test module go.mod and go.sum * Merging new library * Removing junit reporter * Removing deprecated ginkgo argument * Splitting tests to use ginkgo v2 for unit tests and v1 for e2e tests * Minor fixups and linting * more linting * more linting * Fixing spacing * Correcting timeout to align with ginkgo v2 as discussed in onsi/ginkgo#882
Bump Ginkgo's import and refactor the test suite. GinkgoV2 donesn't have built-in timeout param in the BeforeSuite, so to keep having a timeout limit, using a "done" channel as advised here: onsi/ginkgo#882 (comment)
Bump Ginkgo's import and refactor the test suite. GinkgoV2 donesn't have built-in timeout param in the BeforeSuite, so to keep having a timeout limit, using a "done" channel as advised here: onsi/ginkgo#882 (comment)
Required a small change in BeforeSuite to remove the timeout, and use a channel instead. As discussed here: onsi/ginkgo#882 Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Required a small change in BeforeSuite to remove the timeout, and use a channel instead. As discussed here: onsi/ginkgo#882 Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Required a small change in BeforeSuite to remove the timeout, and use a channel instead. As discussed here: onsi/ginkgo#882 Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext * make codegen and manifests * allow access from container users to git directories Related to #4901 Signed-off-by: heanlan <hanlan@vmware.com>
* k8s.io/apimachinery/pkg/util/sets.String was deprecated, and replaced with sets.Set[string]. sets.String.List() was replaced with sets.List(sets.Set[string]). Similar changes happened on sets.Int32, sets.Int64 * k8s.io/apiserver/pkg/registry/rest.Storage interface added requirement on implementation of Destroy() method * k8s.io/component-base/metrics/prometheus/ratelimiter was removed as it was not doing anything. The call in third_party/ipam/nodeipam was removed accordingly. Refer to PR: kubernetes/kubernetes#113054 * upgraded ginkgo to v2 as required by sigs.k8s.io/controller-runtime@v0.14.6. timeout was removed from BeforeSuite, and was refactored referencing to onsi/ginkgo#882 * k8s.io/client-go/tools/remotecommand.Executor.Stream was deprecated, and replaced with StreamWithContext * make codegen and manifests * allow access from container users to git directories Related to antrea-io#4901 Signed-off-by: heanlan <hanlan@vmware.com>
I've upgraded my project to ginkgo v2 today.
With ginkgo v1.x, I could add a 60s timeout to
BeforeSuite
(among other setup nodes) like this:Is there a way to achieve the same behavior in ginkgo v2 ?
The text was updated successfully, but these errors were encountered: