Tobias Gritschacher has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/301376

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/browsertests 
refs/changes/76/301376/1

diff --git a/tests/browser/features/support/modules/entity_module.rb 
b/tests/browser/features/support/modules/entity_module.rb
index 6553c80..7d28ebb 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) do
+      sleep(sleep_period)
+      timeout_loops = 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: newchange
Gerrit-Change-Id: Ia0411955afb70386dc31855fc1d753ac2c235ff1
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/browsertests
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>

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

Reply via email to