Repository navigation
tests: workaround for intermittent first test failures - #832
Merged
Merged
Conversation
vszakats
marked this pull request as draft
March 9, 2023 14:27
vszakats
force-pushed
the
tests-flakyness-test
branch
from
March 9, 2023 14:51
efcc630 to
65b0622
Compare
vszakats
marked this pull request as ready for review
March 9, 2023 18:43
vszakats
force-pushed
the
tests-flakyness-test
branch
2 times, most recently
from
March 9, 2023 20:07
da1b4ab to
6177032
Compare
Flakiness got continously worse these last days. It didn't seem related to recent commits. Flakiness also picked up in GitHub CI runs, something rarely seen before. Manual restart consistently fixed them. The repeating pattern was the _first_ test (`test_hostkey`) failing, with `libssh2_session_handshake failed (-13): Failed getting banner`. Failures came after a lengthy wait, suggesting a timeout. I then reversed the order of the first two tests, and it turned out that the _first_ test failed again (`test_hostkey_hash`). Also pointing to a timeout issue. Then I added a dummy test to "warm up" whatever needs warming up in the layers of CI + Docker + ssh server and their interconnects. This helped, and GitHub CI tests run without failure right for the first time. AppVeyor CI also improved a little. This patch adds a new first test called `test_warmup`, that creates a new libssh2 session, and exits with success even if that attempt failed. A stop-gap solution at best, and there is no guarantee it will continue to fix this or similar future issues, but it's also untenable to have almost every CI run fail for intermittent reasons. In some [1] cases [2] it's not the first test failing intermittently. That's a different issue, and this patch doesn't fix it. [1] libssh2#804 [2] https://ci.appveyor.com/project/libssh2org/libssh2/builds/46440828/job/8rej6cq6itg7vc4w#L500
vszakats
force-pushed
the
tests-flakyness-test
branch
from
March 9, 2023 23:38
6177032 to
c645867
Compare
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
Flakiness got continously worse these last days. It didn't seem related to recent commits. Flakiness also picked up in GitHub CI runs, something rarely seen before. Manual restart consistently fixed them. The repeating pattern was the _first_ test (`test_hostkey`) failing, with `libssh2_session_handshake failed (-13): Failed getting banner`. Failures came after a lengthy wait, suggesting a timeout. I then reversed the order of the first two tests, and it turned out that the _first_ test failed again (`test_hostkey_hash`). Also pointing to a timeout issue. Then I added a dummy test to "warm up" whatever needs warming up in the layers of CI + Docker + ssh server and their interconnects. This helped, and GitHub CI tests run without failure right for the first time. AppVeyor CI also improved a little. This patch adds a new first test called `test_warmup`, that creates a new libssh2 session, and exits with success even if that attempt failed. A stop-gap solution at best, and there is no guarantee it will continue to fix this or similar future issues, but it's also untenable to have almost every CI run fail for intermittent reasons. In some [1] cases [2] it's not the first test failing intermittently. That's a different issue, and this patch doesn't fix it. [1] libssh2#804 [2] https://ci.appveyor.com/project/libssh2org/libssh2/builds/46440828/job/8rej6cq6itg7vc4w#L500
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flakiness got continously worse these last days. It didn't seem related to recent commits. Flakiness also picked up in GitHub CI runs, something rarely seen before. Manual restart consistently fixed them.
The repeating pattern was the first test (
test_hostkey) failing, withlibssh2_session_handshake failed (-13): Failed getting banner. Failures came after a lengthy wait, suggesting a timeout.I then reversed the order of the first two tests, and it turned out that the first test failed again (
test_hostkey_hash). Also pointing to a timeout issue.Then I added a dummy test to "warm up" whatever needs warming up in the layers of CI + Docker + ssh server and their interconnects. This helped, and GitHub CI tests run without failure right for the first time. AppVeyor CI also improved a little.
This patch adds a new first test called
test_warmup, that creates a new libssh2 session, and exits with success even if that attempt failed.A stop-gap solution at best, and there is no guarantee it will continue to fix this or similar future issues, but it's also untenable to have almost every CI run fail for intermittent reasons.
In some cases it's not the first test failing intermittently. That's a different issue, and this patch doesn't fix it.
[ IMO the existing testing technique is on the heavy side with launching Docker machines for each test. It also prevents running tests without Docker, e.g. locally on macOS. It also fails in some of the existing CI machines (seen with GitHub CI MSYS jobs), due to Docker issues. There was #762 to help with this, as a first step. The curl project solved this without Docker. We might tap on those ideas. ]