prow icon indicating copy to clipboard operation
prow copied to clipboard

Fix flake unit test TestAddWithParser

Open danilo-gemoli opened this issue 1 year ago • 8 comments

This PR is an attempt to fix https://github.com/kubernetes/test-infra/issues/31313. As far as I was able to understand the test pulled out the value from the generator (here) before the agent had the time to update it (here). This solution might not be ideal still, due to the 10s time.Sleep but we need to go a pretty extensive refactor to make the test 100% deterministic. Anyway, as far as I know the sleep has never been a problem so far, therefore we might be good this way.

The original PR is https://github.com/kubernetes/test-infra/pull/32385

danilo-gemoli avatar Apr 16 '24 08:04 danilo-gemoli

Welcome @danilo-gemoli!

It looks like this is your first PR to kubernetes-sigs/prow 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/prow has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Apr 16 '24 08:04 k8s-ci-robot

Hi @danilo-gemoli. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Apr 16 '24 08:04 k8s-ci-robot

Deploy Preview for k8s-prow ready!

Name Link
Latest commit c2b956a5fe68037f3cae4f14b6f4b757e7f3d592
Latest deploy log https://app.netlify.com/sites/k8s-prow/deploys/6628de7aa1b5ca00071495ca
Deploy Preview https://deploy-preview-110--k8s-prow.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 16 '24 08:04 netlify[bot]

Note: Another suggested approach for the issue is https://github.com/kubernetes/test-infra/pull/32384.

jihoon-seo avatar Apr 16 '24 08:04 jihoon-seo

I'm having a hard time understanding the point of this unit test - that AddWithParser correctly returns the values from the parsing func? Why is this useful? I also think that moving from channels to mutexes is almost always the wrong path in Go, so I'd like to see a discussion on a) the root cause of the flake and b) whether we need to keep this test or exercise AddWithParser better. For instance - we know our parsing func is strconv.Atoi ... we write "2" and expect an integer. Why do we care about the internals?

stevekuznetsov avatar Apr 17 '24 19:04 stevekuznetsov

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: danilo-gemoli Once this PR has been reviewed and has the lgtm label, please assign droslean for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 24 '24 10:04 k8s-ci-robot

Updated after a conversation with @stevekuznetsov

danilo-gemoli avatar Apr 24 '24 10:04 danilo-gemoli

/ok-to-test

I hope this comment also makes needs-rebase go away, that piece of GH had an incident earlier today.

petr-muller avatar Apr 24 '24 14:04 petr-muller

@danilo-gemoli Is this PR still stands?

droslean avatar Jun 14 '24 12:06 droslean

@stevekuznetsov I don't remember anymore where we were at with this PR. Are you ok with it?

danilo-gemoli avatar Jun 18 '24 07:06 danilo-gemoli