Dalba added a comment.

Looking at this it still seems as though two subsequent searches should return deterministic results (since they are ranked by the same profile), assuming the profile doesn't take previous searches into account. I did spot though that zh.wiki uses a different profile from en.wiki so possibly that is the reason somehow.

Good point.

I don't know if @Magul,has tested the patch or not, but for me it seems that it does not resolve the issue:

(Testing on fawiki)

================================== FAILURES ===================================
____________________ SearchTestCase.test_search_where_text ____________________

self = <tests.site_tests.SearchTestCase testMethod=test_search_where_text>

    def test_search_where_text(self):
        """
            Test the site.search() method with 'where' parameter set to text.
    
            Upper limit of result returned from search is 10000 so if we want to
            have deterministic result we have to test search only on sites with
            lower number of results.
            """
        if len(list(self.site.search('wiki'))) >= 10000:
            self.skipTest('Search result is bigger then 10000')
        self.assertEqual(sorted(self.site.search('wiki')),
>                        sorted(self.site.search('wiki', where='text')))
E       AssertionError: Lists differ: [Page[996 chars]('آرامگاه خیام'), Page('آراگون'), Page('آرتاس [114102 chars]م)')] != [Page[996 chars]('آراگون'), Page('آرتاس منتیل'), Page('آرتاشس [114137 chars]م)')]
E       
E       First differing element 50:
E       Page('آرامگاه خیام')
E       Page('آراگون')
E       
E       Diff is 129706 characters long. Set self.maxDiff to None to see it.

site_tests.py:1423: AssertionError

(Testing on zhwiki)

================================== FAILURES ===================================
____________________ SearchTestCase.test_search_where_text ____________________

self = <tests.site_tests.SearchTestCase testMethod=test_search_where_text>

    def test_search_where_text(self):
        """
            Test the site.search() method with 'where' parameter set to text.
    
            Upper limit of result returned from search is 10000 so if we want to
            have deterministic result we have to test search only on sites with
            lower number of results.
            """
        if len(list(self.site.search('wiki'))) >= 10000:
            self.skipTest('Search result is bigger then 10000')
        self.assertEqual(sorted(self.site.search('wiki')),
>                        sorted(self.site.search('wiki', where='text')))
E       AssertionError: Lists differ: [Page[2032 chars]ge('Clang'), Page('Climateprediction.net'), Pa[52781 chars]问答')] != [Page[2032 chars]ge('Chromium'), Page('Clang'), Page('Climatepr[52763 chars]问答')]
E       
E       First differing element 108:
E       Page('Clang')
E       Page('Chromium')
E       
E       Diff is 65027 characters long. Set self.maxDiff to None to see it.

(second run on fawiki)

================================== FAILURES ===================================
____________________ SearchTestCase.test_search_where_text ____________________

self = <tests.site_tests.SearchTestCase testMethod=test_search_where_text>

    def test_search_where_text(self):
        """
            Test the site.search() method with 'where' parameter set to text.
    
            Upper limit of result returned from search is 10000 so if we want to
            have deterministic result we have to test search only on sites with
            lower number of results.
            """
        if len(list(self.site.search('wiki'))) >= 10000:
            self.skipTest('Search result is bigger then 10000')
        self.assertEqual(sorted(self.site.search('wiki')),
>                        sorted(self.site.search('wiki', where='text')))
E       AssertionError: Lists differ: [Page[628 chars]خرین دلدار او'), Page('آخرین دلدار او'), Page([114519 chars]م)')] != [Page[628 chars]خرین تعظیم'), Page('آخرین هواشکن'), Page('آخون[114425 chars]م)')]
E       
E       First differing element 34:
E       Page('آخرین دلدار او')
E       Page('آخرین تعظیم')
E       
E       Diff is 129465 characters long. Set self.maxDiff to None to see it.

site_tests.py:1423: AssertionError

(second run on zhwiki)

================================== FAILURES ===================================
____________________ SearchTestCase.test_search_where_text ____________________

self = <tests.site_tests.SearchTestCase testMethod=test_search_where_text>

    def test_search_where_text(self):
        """
            Test the site.search() method with 'where' parameter set to text.
    
            Upper limit of result returned from search is 10000 so if we want to
            have deterministic result we have to test search only on sites with
            lower number of results.
            """
        if len(list(self.site.search('wiki'))) >= 10000:
            self.skipTest('Search result is bigger then 10000')
        self.assertEqual(sorted(self.site.search('wiki')),
>                        sorted(self.site.search('wiki', where='text')))
E       AssertionError: Lists differ: [Page[2032 chars]ge('Clang'), Page('Climateprediction.net'), Pa[52779 chars]问答')] != [Page[2032 chars]ge('Chromium'), Page('Clang'), Page('Climatepr[52781 chars]问答')]
E       
E       First differing element 108:
E       Page('Clang')
E       Page('Chromium')
E       
E       Diff is 65090 characters long. Set self.maxDiff to None to see it.

I could not pass the test with the patch, but without it the test used to pass occasionally. Increasing the total limit seems to have increased the fail probability.


TASK DETAIL
https://phabricator.wikimedia.org/T151369

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Magul, Dalba
Cc: Lokal_Profil, Xqt, jayvdb, Dalba, gerritbot, pywikibot-bugs-list, Aklapper, Magul, Th3d3v1ls, Ramalepe, Liugev6, Tbscho, MayS, Lewizho99, Mdupont, JJMC89, Maathavan, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to