summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-12 08:19:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-12 11:15:57 +0200
commit26298f29e9d36313be527b785a9bb96089582037 (patch)
treef3b42647719f4984a92d1011fa504657a98311f2 /sw
parent361c46fdcc18840f673bd65224d1542ea570d73d (diff)
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@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/writer_tests3/insertSignatureLine.py30
1 files changed, 16 insertions, 14 deletions
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: