CI: Introduce flaky test finder#38523
Conversation
|
Janky worked correctly: and it looks that others do not have .git folder mounted so they cannot use this. And this is output from Janky after I dropped example flaky tests from this PR: |
|
(reserved for my derek commands) |
4a5d478 to
a503265
Compare
Codecov Report
@@ Coverage Diff @@
## master #38523 +/- ##
==========================================
+ Coverage 36.64% 36.7% +0.06%
==========================================
Files 608 608
Lines 45173 45230 +57
==========================================
+ Hits 16553 16603 +50
- Misses 26339 26340 +1
- Partials 2281 2287 +6 |
|
@vdemeester @kolyshkin PTAL |
a503265 to
f7c69d5
Compare
|
/cc @tonistiigi |
|
This is really cool! I was also thinking if we could label flaky tests in the test itself, and either run them separate, e.g. have a special "skip"; skip.If(t, SkipFlakyTests)Then either;
|
|
@tonistiigi how you btw generate that one? I have been working on similar stats on https://github.com/olljanat/moby-jenkins-statistics but I can see that you have data from longer period. |
@thaJeztah For existing known flaky tests it is option but I'm not sure how actually run only tests which have SkipFlakyTests flag? |
Might be hacky. Some quick thoughts;
|
https://gist.github.com/tonistiigi/2e474449ac80e25753a84712e19dfd4d . I have all master logs/status from build 9564 if you are interested. Lost couple of days in the last run because I forgot to run it in december. Only master as PRs may be just failing because of actual bugs. |
… tests for all existing integration tests Signed-off-by: Olli Janatuinen <[email protected]>
That is probably easiest but as most of the flaky tests are actually on legacy integration-cli tests it is better to do that on another PR. Btw. I also tested to run this logic for all existing tests on integration and this was the result: #38520 will fix TestServiceUpdateLabel and TestCreateServiceSecretFileMode is already reported on #37132 |
7d0ef03 to
b3e49df
Compare
|
Updated 😄 |
|
LGTM, and thanks 👍 |
comparing PR commit(s) to HEAD of moby/moby master branch and if founds new (or renamed) integration tests will run stress tests for them. Signed-off-by: Olli Janatuinen <[email protected]>
b3e49df to
8a8fd37
Compare
|
Hmm. Weird error on Janky. Maybe some server where it try connect is failing? Let's try once more... |
|
Between @thaJeztah and @cpuguy83, my syntax comments are all taken! 🙌 ❤️ This looks sane to me. 👍 |
|
Thanks!! |
| ( | ||
| TESTARRAY=$(echo "$new_tests" | sed 's/+func //' | awk -F'\\(' '{print $1}' | tr '\n' '|') | ||
| export TESTFLAGS="-test.count 5 -test.run ${TESTARRAY%?}" | ||
| export TEST_REPEAT=5 |
There was a problem hiding this comment.
@olljanat @thaJeztah why set both -test.count 5 and TEST_REPEAT 5 ? That will run 25 times. Also, if you do set -test.count you need to export TIMEOUT=... (which will set -test.timeout) to 5 times the existing TIMEOUT.
There was a problem hiding this comment.
5 runs is not enough to find example known flaky test TestCreateServiceSecretFileMode. Look comments above when I tested to run this to existing tests.
Difference between this and just run 25 times is this will restart daemon after every 5 test runs.
Increasing timeout of course can be done if needed.
Btw. Did you saw this timeouting on some PR now?
Makes sense to add a comment explaining that |
|
Thanks I'll fix it in #38693 |
- What I did
We all hate to see CI builds to failing randomly to flaky tests.
Lot of work will be needed before all builds will run smoothly but to make sure that any PR does not make things worse I implemented "flaky test finder" which detect new integration tests from PR commits and run stress tests for them.
- How I did it
Included bash script which:
- How to verify it
Included second commit ( 4a5d478 ) which contains two example flaky tests. I will drop that after design is approved.