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 errors on AIX #78554

Closed
aixtools opened this issue Aug 10, 2018 · 6 comments
Closed

test_time errors on AIX #78554

aixtools opened this issue Aug 10, 2018 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@aixtools
Copy link
Contributor

BPO 34373
Nosy @ncoghlan, @vstinner, @aixtools, @kadler
PRs
  • bpo-34373: fix test_mktime and test_pthread_getcpuclickid tests on AIX #8726
  • bpo-34373: Fix time.mktime() on AIX #12726
  • [3.7] bpo-34373: Fix time.mktime() on AIX (GH-12726) #14242
  • 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 2018-12-28.14:06:07.332>
    created_at = <Date 2018-08-10.16:15:51.845>
    labels = ['interpreter-core', '3.8', 'type-bug', 'tests', '3.7']
    title = 'test_time errors on AIX'
    updated_at = <Date 2019-06-19.19:09:09.241>
    user = 'https://github.com/aixtools'

    bugs.python.org fields:

    activity = <Date 2019-06-19.19:09:09.241>
    actor = 'Michael.Felt'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-12-28.14:06:07.332>
    closer = 'ncoghlan'
    components = ['Interpreter Core', 'Tests']
    creation = <Date 2018-08-10.16:15:51.845>
    creator = 'Michael.Felt'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34373
    keywords = ['patch']
    message_count = 6.0
    messages = ['323372', '324412', '332657', '337635', '337697', '339786']
    nosy_count = 4.0
    nosy_names = ['ncoghlan', 'vstinner', 'Michael.Felt', 'kadler']
    pr_nums = ['8726', '12726', '14242']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34373'
    versions = ['Python 3.7', 'Python 3.8']

    @aixtools
    Copy link
    Contributor Author

    32-bit:

    ======================================================================
    ERROR: test_mktime (test.test_time.TimeTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/data/prj/python/src/python3-3.7.0/Lib/test/test_time.py", line 446, in test_mktime
        self.assertEqual(time.mktime(tt), t)
    OverflowError: mktime argument out of range

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

    Traceback (most recent call last):
      File "/data/prj/python/src/python3-3.7.0/Lib/test/test_time.py", line 129, in test_pthread_getcpuclockid
        self.assertNotEqual(clk_id, time.CLOCK_THREAD_CPUTIME_ID)
    AssertionError: 12 == 12

    64-bit:
    ======================================================================
    ERROR: test_mktime (test.test_time.TimeTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/opt/lib/python3.7/test/test_time.py", line 446, in test_mktime
        self.assertEqual(time.mktime(tt), t)
    OverflowError: mktime argument out of range

    ======================================================================
    ERROR: test_pthread_getcpuclockid (test.test_time.TimeTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/opt/lib/python3.7/test/test_time.py", line 130, in test_pthread_getcpuclockid
        t1 = time.clock_gettime(clk_id)
    OverflowError: signed integer is greater than maximum

    The test_mktime failed because
    time.mktime(time.localtime(-2)) -- actually any negative value in localtime - fails

    The patch in the file Modules/timemodule.c fixes this.

    The test_pthread_getcpuclockid is a bit more complex as the result is different
    depending on 32 or 64-bit mode.

    In 32-bit mode AIX always responds with the constant CLOCK_THREAD_CPUTIME_ID.
    The patch in Lib/test/test_time.py makes the test aware of this.

    In AIX clockid_t is actually long long. However, changing the type to parse to "L"
    broke many other things. It seems to work as a long ("l") when the ABI is 64-bit.

    See additional change in Modules/timemodule.c
    static PyObject *
    time_clock_gettime

    Finally,
    added some (additional) range checking for
    _PyTime_localtime for AIX. Not having this complicated testing for above.

    @aixtools aixtools added 3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) tests Tests in the Lib/test dir labels Aug 10, 2018
    @aixtools
    Copy link
    Contributor Author

    Would be very nice to get this to clear on the build bots!

    @aixtools aixtools added type-bug An unexpected behavior, bug, or error and removed 3.7 (EOL) end of life labels Sep 11, 2018
    @ncoghlan
    Copy link
    Contributor

    New changeset e2926b7 by Nick Coghlan (Michael Felt) in branch 'master':
    bpo-34373: fix test_mktime and test_pthread_getcpuclickid tests on AIX (GH-8726)
    e2926b7

    @aixtools
    Copy link
    Contributor Author

    Could this alos be backported to Version 3.7 and 3.6 - thx!

    @aixtools aixtools added the 3.7 (EOL) end of life label Mar 10, 2019
    @aixtools
    Copy link
    Contributor Author

    On 10/03/2019 19:43, Michael Felt wrote:

    Michael Felt <aixtools@felt.demon.nl> added the comment:

    Could this alos be backported to Version 3.7 and 3.6 - thx!
    As 3.6 is in security mode - I guess only 3.7 then.
    ----------
    versions: +Python 3.6, Python 3.7


    Python tracker <report@bugs.python.org>
    <https://bugs.python.org/issue34373\>


    @vstinner
    Copy link
    Member

    vstinner commented Apr 9, 2019

    New changeset 8709490 by Victor Stinner in branch 'master':
    bpo-34373: Fix time.mktime() on AIX (GH-12726)
    8709490

    @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 interpreter-core (Objects, Python, Grammar, and Parser dirs) tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants