kubernetes-sigs / e2e-framework

A Go framework for end-to-end testing of components running in Kubernetes clusters.
Apache License 2.0
529 stars 103 forks source link

Why does `-parallel` and `-fail-fast` can't be used together? #385

Closed Fricounet closed 1 month ago

Fricounet commented 9 months ago

Hello :wave: I'm trying to understand why flags -parallel and -fail-fast can't be used together. I've looked at the PR that implemented the fail-fast but couldn't find a reason as to why they can't be used together. I'm asking because I've been using -fail-fast with t.Parallel() in my tests without running into any issue so I wonder what is different with -parallel?

vladimirvivien commented 7 months ago

@Fricounet Apologies for the delay. So, you are saying that you can run tests with --fail-fast and call to t.Parallel but can't do it with --parallel flag ? Do you get an error ?

Fricounet commented 7 months ago

@vladimirvivien no worries Well the error I get when running -fail-fast and parallel is part of the framework itself. It is defined here https://github.com/kubernetes-sigs/e2e-framework/blob/main/pkg/flags/flags.go#L283

That's why I don't quite understand why :sweat_smile: I thought that maybe I'm just missing some context on why this decision was made initially

vladimirvivien commented 7 months ago

@Fricounet Looking at the code I think I remember why it was encoded like that. Maybe the thinking was that if the framework is executing tests concurrently, fail-fast would have to be applied to all tests inflight and end the entire test run. Having that mutual exclusivity makes it easier to reason about.

If you have an idea that can make this better, you should definitely discuss here. Again, a lot of those decisions were done early on, so they may be due for a revisit.

Fricounet commented 7 months ago

@vladimirvivien What do you think about canceling the parent context if fail-fast is enabled? This way all currently running tests would have to stop too?

I can try to take a look and see if I can come up with a PR. Thanks for the context anyway :)

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

vladimirvivien commented 3 months ago

@Fricounet are you still interested in working on this ?

Fricounet commented 3 months ago

@vladimirvivien yes! I'll try to work on this next week

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 1 month ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/e2e-framework/issues/385#issuecomment-2383846982): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.