EBernhardson has uploaded a new change for review.

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

Change subject: Wait for job to finish processing before doing commons checks
......................................................................

Wait for job to finish processing before doing commons checks

The browser tests have been intermittently failing the commons tests,
and it's quite annoying. The retrys in cindy don't help here, because
the test setup deletes and recreates these pages. If the commons tests
are the only ones being run its probably more likely than in a full test
that the jobs havn't completed.

This is a bit of a hack, to make this better we would probably want to
add an API action that mimics action=cirrusdump, but it will do the
trick for now at least.

Change-Id: I7f3a8e21907ef136038efa507d5150b76e805d1d
---
M tests/browser/features/commons.feature
M tests/browser/features/step_definitions/search_steps.rb
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/28/325428/1

diff --git a/tests/browser/features/commons.feature 
b/tests/browser/features/commons.feature
index 675b196..3051ae7 100644
--- a/tests/browser/features/commons.feature
+++ b/tests/browser/features/commons.feature
@@ -5,7 +5,8 @@
     Then File:OnCommons.svg is the first api search result
 
   Scenario: A file that exists on commons and the local wiki returns the local 
result
-    When I api search in namespace 6 for duplicated
+    When within 20 seconds File:DuplicatedLocally.svg has cirrustestwiki as 
local_sites_with_dupe
+    Then I api search in namespace 6 for duplicated
     Then File:DuplicatedLocally.svg is the first api search result
     And Locally stored file *duplicated* on commons is the highlighted snippet 
of the first api search result
     And there is no second api search result
diff --git a/tests/browser/features/step_definitions/search_steps.rb 
b/tests/browser/features/step_definitions/search_steps.rb
index adecca3..793aa97 100644
--- a/tests/browser/features/step_definitions/search_steps.rb
+++ b/tests/browser/features/step_definitions/search_steps.rb
@@ -497,6 +497,14 @@
     step("#{title} is the first suggestion")
   end
 end
+Then(/^within (\d+) seconds (.*) has (.*) as local_sites_with_dupe$/) do 
|seconds, page, value|
+  on_wiki('commons') do
+    within(seconds) do
+      step("I dump the cirrus data for " + page)
+      step('the page text contains "local_sites_with_dupe":["' + value + '"]')
+    end
+  end
+end
 Then(/^there is (no|a)? link to create a new page from the search result$/) do 
|modifier|
   with_browser do
     if modifier == "a"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f3a8e21907ef136038efa507d5150b76e805d1d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>

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

Reply via email to