-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
Add flaky test mitigation #261
Conversation
I see no integration tests for this feature, and I suspect that these new flags are not actually propagated. Can you add a test to |
OK, I'll add a test asap. |
Integration tests added. @tedsuo was there some particular thing you were concerned about? It passed as-is. |
At a glance, it looked like these flags would have to propagate through Thanks for the integration tests. I'll manually review tomorrow. |
Ah, I didn't see that section. I will add them there tomorrow, that looks On Tue, Jun 28, 2016 at 10:31 PM, Ted Young notifications@github.com
|
@tedsuo sorry to be pushy-- any more comments? |
hi @lavalamp - sorry for the delay. I'll commit to merging this in, but some comments:
|
Done-- I was thinking I might want to require more than a 50% pass rate but we can cross that bridge when it becomes an actual problem.
I've run out of steam tonight but I'll try to take a look at this soon. |
I guess the obvious thing to do is add a "NumberOfFlakySpecs" to the suite summary and let the reporters handle that as appropriate. The stenographer interface is harder, since a "flake" is really N failures followed by a pass for the same spec. I'll think about this more tomorrow. At the very least I can add some documentation warning users about the behavior of this flag (pushed just now). |
I added the flake concept to the suite summary and to the spec object. Please let me know if you think this is good, or if I should do something like run the test N times and then report the result a single time. |
@onsi anything I can do to move this along? |
Hey @lavalamp bear with me. We're exploring a couple of different patterns for doing this. I have a commit on a branch: https://github.com/onsi/ginkgo/tree/runlists That adds the ability to emit failed tests to a file then run only tests in said file. Details: ginkgo --writeFailuresFile=path/to/file.json will write to file.json if and only if there are test failures. it will export a list of failed tests detailing the name of the test, the coordinates of the test, and the failure reason. if nothing fails no file is written however if a file with that name already exists it will not be removed (should it be?) ginkgo --runFailuresFile=path/to/file.json will run only the tests listed in file.json. if file.json doesn't exist or is malformed ginkgo panics (so its on you to write the code that says "is this file here? should i rerun the tests?). i think passing both flags in will work so you can rerun until there are no failures. We're going to try this interface IRL and weigh it against your approach. This requires a bit more work on the test runners side (e.g. a bash script that reruns ginkgo until it exits 0) but it does leave a better trail of breadcrumbs and will be harder for folks to abuse. |
That approach will call before/afterSuite multiple times. Also, putting
|
FWIW, there are ways to wed the two approaches without any extra mechanisms: ginkgo --writeReport=path/to/file.json
ginkgo --writeReport=path/to/file.json --retryFailures=2
ginkgo --retryReport=path/to/file.json --retryFailures=1 ginkgo --writeReport=path/to/file.json [[--retryFailures=0]]
If ginkgo --retryReport=path/to/file.json [[--retryFailures=0]]
|
I guess I don't understand what that gains us-- can't I just do that now by parsing the junit file and rerunning the failures? |
hey @lavalamp am going to pull this in. so you mind writing up some docs for the gh-pages branch when you have a moment? |
Thanks! I will send you some docs. |
Automatic merge from submit-queue Detect flakes in PR builder e2e runs Won't be mergable until onsi/ginkgo#261 is agreed upon and merged. Tossing a PR here to get the e2e test to run on it.
Implements #260