jenkins-bot has submitted this change and it was merged.

Change subject: Do not fail tests when ajax_requests are stuck
......................................................................


Do not fail tests when ajax_requests are stuck

Changing the timeout in ajax_wait to a "soft" timeout that does not let
the test fail if there is an ajax_request stuck.

Change-Id: Ia0411955afb70386dc31855fc1d753ac2c235ff1
---
M tests/browser/features/support/modules/entity_module.rb
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  WMDE-Fisch: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/browser/features/support/modules/entity_module.rb 
b/tests/browser/features/support/modules/entity_module.rb
index 6553c80..15ac139 100644
--- a/tests/browser/features/support/modules/entity_module.rb
+++ b/tests/browser/features/support/modules/entity_module.rb
@@ -112,8 +112,13 @@
   end
 
   def ajax_wait
-    Timeout.timeout(5) do
-      sleep(1.0 / 3) while execute_script('return jQuery.active') != 0
+    sleep_period = 0.25
+    timeout_seconds = 2
+    timeout_loops = (timeout_seconds / sleep_period).to_i
+
+    while execute_script('return jQuery.active') != 0 && timeout_loops > 0
+      sleep(sleep_period)
+      timeout_loops -= 1
     end
     sleep 1
     true

-- 
To view, visit https://gerrit.wikimedia.org/r/301376
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia0411955afb70386dc31855fc1d753ac2c235ff1
Gerrit-PatchSet: 4
Gerrit-Project: wikidata/browsertests
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: WMDE-Fisch <christoph.fisc...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to