[Libreoffice-commits] core.git: sw/qa

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 12 09:16:33 UTC 2020


 sw/qa/uitest/writer_tests3/insertSignatureLine.py |   30 +++++++++++-----------
 1 file changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 26298f29e9d36313be527b785a9bb96089582037
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Aug 12 08:19:28 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Aug 12 11:15:57 2020 +0200

    Avoid repeated calls to document.DrawPage.getByIndex(0)
    
    I have seen various failures with (slow) ASan+UBSan builds where some other
    than the first one of those self.assertEqual failed.  I would assume that they
    rather either all succeed or all fail (in which case consistently the first one
    in each of those self.assertEqual blocks should fail).  To rule out the
    possibility that, for some timing/race reason, the identity of the element
    provided by document.DrawPage.getByIndex(0) changes midway through those blocks,
    only obtain that element once per block.
    
    Examples of such failures during UITest_writer_tests3 are
    <https://ci.libreoffice.org//job/lo_ubsan/1725/>
    
    > FAIL: test_insert_signature_line (insertSignatureLine.insertSignatureLine)
    > ----------------------------------------------------------------------
    > Traceback (most recent call last):
    >   File "/home/tdf/lode/jenkins/workspace/lo_ubsan/sw/qa/uitest/writer_tests3/insertSignatureLine.py", line 53, in test_insert_signature_line
    >     self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
    > AssertionError: None != 'Email'
    
    and my local build
    
    > FAIL: test_insert_signature_line2 (insertSignatureLine.insertSignatureLine)
    > ----------------------------------------------------------------------
    > Traceback (most recent call last):
    >   File "/home/sbergman/lo/core/sw/qa/uitest/writer_tests3/insertSignatureLine.py", line 91, in test_insert_signature_line2
    >     self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineShowSignDate, False)
    > AssertionError: None != False
    
    Change-Id: I2739edb12ed39892f5b29999b9e3d632e166c1c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100572
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/qa/uitest/writer_tests3/insertSignatureLine.py b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
index 8bbbdd65b93d..eb75b6cc89b2 100644
--- a/sw/qa/uitest/writer_tests3/insertSignatureLine.py
+++ b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
@@ -48,13 +48,14 @@ class insertSignatureLine(UITestCase):
         xOKBtn.executeAction("CLICK", tuple())
 
         #check the signature Line in the document
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineShowSignDate, True)
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
+        element = document.DrawPage.getByIndex(0)
+        self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
+        self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+        self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
+        self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+        self.assertEqual(element.SignatureLineCanAddComment, False)
+        self.assertEqual(element.SignatureLineShowSignDate, True)
+        self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
 
         self.ui_test.close_doc()
 
@@ -83,13 +84,14 @@ class insertSignatureLine(UITestCase):
         xOKBtn.executeAction("CLICK", tuple())
 
         #check the signature Line in the document
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineShowSignDate, False)
-        self.assertEqual(document.DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
+        element = document.DrawPage.getByIndex(0)
+        self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
+        self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+        self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
+        self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+        self.assertEqual(element.SignatureLineCanAddComment, False)
+        self.assertEqual(element.SignatureLineShowSignDate, False)
+        self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
 
         self.ui_test.close_doc()
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list