Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 #80635

Closed
vstinner opened this issue Mar 28, 2019 · 3 comments
Closed
Labels
3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 36454
Nosy @vstinner, @koobs, @miss-islington
PRs
  • bpo-36454: Fix test_time.test_monotonic() #12929
  • [3.7] bpo-36454: Fix test_time.test_monotonic() (GH-12929) #12930
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-04-23.23:46:23.783>
    created_at = <Date 2019-03-28.01:54:53.642>
    labels = ['3.8', '3.7', 'tests']
    title = 'test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7'
    updated_at = <Date 2019-04-24.10:51:29.845>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-04-24.10:51:29.845>
    actor = 'koobs'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-23.23:46:23.783>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2019-03-28.01:54:53.642>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36454
    keywords = ['patch']
    message_count = 3.0
    messages = ['339002', '340744', '340745']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'koobs', 'miss-islington']
    pr_nums = ['12929', '12930']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36454'
    versions = ['Python 3.7', 'Python 3.8']

    @vstinner
    Copy link
    Member Author

    AMD64 FreeBSD 10-STABLE Non-Debug 3.7:
    https://buildbot.python.org/all/#/builders/170/builds/354

    ======================================================================
    FAIL: test_monotonic (test.test_time.TimeTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/usr/home/buildbot/python/3.7.koobs-freebsd10.nondebug/build/Lib/test/test_time.py", line 474, in test_monotonic
        self.assertTrue(0.45 <= dt <= 1.0, dt)
    AssertionError: False is not true : 1.0372954378835857

    Extract of the test:

        def test_monotonic(self):
            ...
    
            # monotonic() includes time elapsed during a sleep
            t1 = time.monotonic()
            time.sleep(0.5)
            t2 = time.monotonic()
            dt = t2 - t1
            self.assertGreater(t2, t1)
            # Issue python/cpython#64300: On some Windows machines, dt may be slightly low
            self.assertTrue(0.45 <= dt <= 1.0, dt)
        ...
    

    IMHO the test is too strict. It should not test the maximum value of dt, only the minimum.

    @vstinner vstinner added 3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir labels Mar 28, 2019
    @vstinner
    Copy link
    Member Author

    New changeset d246a67 by Victor Stinner in branch 'master':
    bpo-36454: Fix test_time.test_monotonic() (GH-12929)
    d246a67

    @miss-islington
    Copy link
    Contributor

    New changeset e1a6cf2 by Miss Islington (bot) in branch '3.7':
    bpo-36454: Fix test_time.test_monotonic() (GH-12929)
    e1a6cf2

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants