This is an automated email from the ASF dual-hosted git repository.

pgj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 4ace5f13971aba8d3f858a69ea5f4404b5355951
Author: Gabor Pali <[email protected]>
AuthorDate: Thu Nov 30 14:36:46 2023 +0100

    mango: increase timeout for flaky `text` search test with floats
    
    The following exception was observed on the CI (excerpt):
    
    ```
    ERROR: test_floating_point_val (06-basic-text-test.NumStringTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File 
"/home/jenkins/workspace/jenkins-cm1_PullRequests_PR-4871/24.3.4.14/build/apache-couchdb-3.3.2-e464422/src/mango/test/06-basic-text-test.py",
 line 583, in test_floating_point_val
        @example("NaN")
      File 
"/home/jenkins/workspace/jenkins-cm1_PullRequests_PR-4871/24.3.4.14/build/apache-couchdb-3.3.2-e464422/src/mango/.venv/lib/python3.9/site-packages/hypothesis/core.py",
 line 1190, in wrapped_test
        raise the_error_hypothesis_found
      File 
"/home/jenkins/workspace/jenkins-cm1_PullRequests_PR-4871/24.3.4.14/build/apache-couchdb-3.3.2-e464422/src/mango/.venv/lib/python3.9/site-packages/hypothesis/core.py",
 line 886, in __flaky
        raise Flaky(message)
    hypothesis.errors.Flaky: Hypothesis 
test_floating_point_val(self=<06-basic-text-test.NumStringTests 
testMethod=test_floating_point_val>, f='-0x1.70cc4f85b0b06p-938') produces 
unreliable results: Falsified on the first call but did not on a subsequent one
    [..]
    Falsifying example: test_floating_point_val(
        f='-0x1.70cc4f85b0b06p-938',
        self=<06-basic-text-test.NumStringTests 
testMethod=test_floating_point_val>,
    )
    Unreliable test timings! On an initial run, this test took 255.29ms, which 
exceeded the deadline of 200.00ms, but on a subsequent run it took 49.44 ms, 
which did not. If you expect this sort of variability in your test timings, 
consider turning deadlines off for this test by setting deadline=None.
    
    You can reproduce this example by temporarily adding 
@reproduce_failure('6.31.6', b'AAFGBwQA+pYNDaHyMw4B') as a decorator on your 
test case
    ```
    
    As the note suggests in the report, make an attempt to fix the
    issue by bumping the value of the associated default deadline.
---
 src/mango/test/06-basic-text-test.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mango/test/06-basic-text-test.py 
b/src/mango/test/06-basic-text-test.py
index 03891a840..da3eb6ff5 100644
--- a/src/mango/test/06-basic-text-test.py
+++ b/src/mango/test/06-basic-text-test.py
@@ -15,7 +15,7 @@ import mango
 import unittest
 import user_docs
 import math
-from hypothesis import given, assume, example
+from hypothesis import given, assume, example, settings
 import hypothesis.strategies as st
 
 
@@ -580,6 +580,7 @@ class NumStringTests(mango.DbPerClass):
         not (math.isinf(num) or math.isnan(num))
 
     @given(f=st.floats().filter(isFinite).map(str) | st.floats().map(lambda f: 
f.hex()))
+    @settings(deadline=1000)
     @example("NaN")
     @example("Infinity")
     def test_floating_point_val(self, f):

Reply via email to