https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35506 --- Comment #20 from Victor Grousset/tuxayo <victor@tuxayo.net> --- (In reply to Jonathan Druart from comment #19)
1. What is DT_delay for?
We want to make sure the AJAX request is there. In some cases (see bug 35284), the wait_for_ajax was called but the AJAX request was not triggered yet, so we didn't wait for it to finished.
Ouch, yet another bad thing that can happen >_< Thankfully, I had no sign of that happening in my +2000 runs. But it might happen on the CI thanks to Murphy's law. So I added it in my WIP patch. -----
2. I only though of it just now: instead of having the flag window._pageFullyReady, should the problematic buttons be hidden in the HTML? (and maybe have a dummy button with a loading icon in place to show the user that stuff it loading) And then the stuff in $(document).ready() makes them visible after setting the onclick callback. And the test just waits for the button to be visible instead of the flag to be set.
We should not need more than wait_for_ajax here IMO.
That's not what is happening here. The wait_for_page_fully_ready uses are for distinct places than wait_for_ajax. Each time it's about not clicking the "Show checkouts" button before it's callback is set. So no XHR involved here to wait for as an alternative.
If it takes more than 10 sec then there is something wrong somewhere else.
That's another thing than the use of wait_for_page_fully_ready. At least on my machine, the XHR can indeed take more than 10 sec to return (and still work), many times over all my runs. I'm not sure there is really a problem other than a perfect storm that makes the request horribly slow sometimes.
We could extend the delay specifically for this call.
That's precisely what it done in my patch. That's why I had to turn max_retries from a constant to a field with accessors. -- You are receiving this mail because: You are watching all bug changes.