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

Change subject: test: wait for changes to propagate
......................................................................


test: wait for changes to propagate

Retry after a change is made to test.wikidata.org because the API
frontend sometime lag behind a few seconds.

Change-Id: Ib91f229e149b6f507e28abed0b3fad6eac8358aa
Signed-off-by: Loic Dachary <l...@dachary.org>
---
M FLOSSbot/bot.py
M tests/test_bot.py
2 files changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/FLOSSbot/bot.py b/FLOSSbot/bot.py
index d7c8d59..20b34e9 100644
--- a/FLOSSbot/bot.py
+++ b/FLOSSbot/bot.py
@@ -148,5 +148,8 @@
         found = self.lookup_entity(label, type=type)
         if not found and self.args.test:
             self.create_entity(type, label)
-            found = self.lookup_entity(label, type=type)
+            for i in range(120):
+                found = self.lookup_entity(label, type=type)
+                if found is not None:
+                    break
         return found
diff --git a/tests/test_bot.py b/tests/test_bot.py
index eead047..a4338a3 100644
--- a/tests/test_bot.py
+++ b/tests/test_bot.py
@@ -68,6 +68,10 @@
             assert 1 == len(bot.entities['property'])
             bot.clear_entity_label(property)
             assert 0 == len(bot.entities['property'])
+            for i in range(120):
+                if (bot.lookup_entity(
+                        attr, type='property') is None):
+                    break
             property = bot.__getattribute__(attr)
             assert 1 == len(bot.entities['property'])
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib91f229e149b6f507e28abed0b3fad6eac8358aa
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary <l...@dachary.org>
Gerrit-Reviewer: Dachary <l...@dachary.org>
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