Fix race conditions(?)#166
Conversation
In most cases this will be negligible, but it's another safety.
Becuase the `@retry_limit` time span was initialised with the object, the time had already partially elapsed becaus of any setups that would happen afterwards. This fix makes sure the full time span is available from the moment the session is started.
This is just a precaution because in most cases the DOM should be ready
Cookies were already cleared, but any remants form the previous DOM could still be present. This makes sure the DOM starts fresh every time.
|
😱 omg, will this fix the issues I was having that I mentioned in luckyframework/lucky_cli#890 ? That would be amazing 🙌 |
|
I don't know, that's why I added the question mark to the title 😄. This could fix it, but you have to see for yourself. So pull in my branch before merging it in. At least this makes sure that everything is ready and set up before actually testing, and that there's nothing left in the DOM from previous tests, which could also be a source for weird errors. |
|
May potentially (hopefully) fix luckyframework/lucky_cli#883 .. 🤞 |
|
I can't tell if this made it better or not... but there was still a CI failure However, there was only 1 failure, so it's possible this made a difference. I'm just not sure how to tell 🤔 |
|
Hmm, I haven't seen any so far but this looks like a timing issue again. I'll have a look at it today. Are you seeing less errors than before? Or about the same? |
|
Another tiny fix based on the error you linked, particularly this line: It may be that the references from the This is a bit like shooting in the dark 😄, but if we keep tracing them down I suppose we'll get there eventually. I know it's not the prettiest fix, but at least it rules out the timing issue here. |
|
oh snap! luckyframework/lucky_cli#925 It's green! I think this may have worked :D |
jwoertink
left a comment
There was a problem hiding this comment.
I say we give it a shot. Can't be worse than what exists now where Flow specs don't even run 😂 The fact that I was able to take existing specs and just run them and get all green is very promising 🙌
I'm mildly optimistic about this update. I haven't seen any errors so far.
SESSION_RETRY_LIMITThe biggest issue I think was the
@retry_limitinstance variable in the selenium driver class. Any delays in the setup, after initialization and before the actual tests were run, would eat into the time span. Now the full time span is considered.The
wait_for_readymethodWaits for the DOM to be ready. That's just a precaution,
Navigate to
about:blankon resetJust to make sure no remnants of the previous test are left. Essentially always starting with a blank slate.
LuckyFlow.wait_for_serverThis is a small addition to apps to make sure the app's http server is ready to receive requests. So the
spec/setup/start_app_server.crfile now looks like: