Attempt at un-flaky'ing the preview a very long message
cucumber scenario
#8428
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.
... by making the extremely long status message shorter.
This wasn't fun to debug, and honestly, I still don't know if this is even a fix. Here's what I think happened:
In #8418, we switched from
apparition
tocuprite
, primarily because apparition is unmaintained. Both are remote-controlling Chrome via the Chrome Devtools Protocol (CDP). This is technically a bit of a hack, but a fine one (right now), because standardized cross-browser bi-direction remote control is still WIP at the moment (although there's good progress!).cuprite
usesferrum
internally, which is a high-level API for CDP.Recently, the
preview a very long message
scenario infeatures/desktop/post_preview.feature
started becoming flaky, and it's more red than green. The odd thing here was that the test timed out while entering text into the publisher:and this kinda makes no sense. I did convince Cucumber to make screenshots of the failure, and GitHub to store those for me, and ... you can clearly see that all the text is there at the time of failure, so that makes even less sense, because that means that a) it found the element to type into, b) it was able to type into.
I noticed, however, that the error we were getting was
Ferrum::TimeoutError
. This is odd, because for most things that can go wrong (like element search timeouts, etc) there's a level of abstraction above that, and I'd expect aCapybara::*
error. So what's happening here is that there somehow was a timeout sending or receiving a CDP message to the browser.Anyway, it looks like the old message, being 2048 chars long, apparently sometimes tripped up Ferrum or Chrome itself. This PR replaces this with
"long post\n" * 15
, which is only 150 chars. The new, shorter, message does break less (or not at all - I ran a couple of runs and didn't see it break once). It's still long enough, though, as the way we determine if a status message is "too long" is by height only, so line-breaks work.I'm still not convinced that this is actually a reliable fix, which is why I'm leaving this essay here. If we ever have to come back, at least we know what not to try. 馃檭