pypy3 5.10.0: Timeout tests never timeout on i686

Issue #2717 resolved
Miro Hrončok
created an issue

Comments (15)

  1. mattip

    The tests pass on our buildbot. I wonder what is different. Are there patches Fedora applies to the raw pypy repo? That test is meant to set up two sockets and pass a message between them, can you run it by hand and see what is failing?

  2. Miro Hrončok reporter

    Testing in mock (the build environment), will try an actual i686 virtual machine later.

    First thing, running pypy3 -m test.test_socket hangs as well, at this point:

    testInsideTimeout (__main__.NetworkConnectionBehaviourTest) ... ^CTraceback (most recent call last):
      File "/usr/lib/pypy3-5.10.0/lib-python/3/runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/test/test_socket.py", line 5401, in <module>
        test_main()
      File "/usr/lib/pypy3-5.10.0/lib-python/3/test/test_socket.py", line 5397, in test_main
        support.run_unittest(*tests)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/test/support/__init__.py", line 1897, in run_unittest
        _run_suite(suite)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/test/support/__init__.py", line 1863, in _run_suite
        result = runner.run(suite)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/runner.py", line 176, in run
        test(result)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/suite.py", line 84, in __call__
        return self.run(*args, **kwds)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/suite.py", line 122, in run
        test(result)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/suite.py", line 84, in __call__
        return self.run(*args, **kwds)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/suite.py", line 122, in run
        test(result)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/case.py", line 649, in __call__
        return self.run(*args, **kwds)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/unittest/case.py", line 604, in run
        self.tearDown()
      File "/usr/lib/pypy3-5.10.0/lib-python/3/test/test_socket.py", line 262, in _tearDown
        self.done.wait()
      File "/usr/lib/pypy3-5.10.0/lib-python/3/threading.py", line 549, in wait
        signaled = self._cond.wait(timeout)
      File "/usr/lib/pypy3-5.10.0/lib-python/3/threading.py", line 293, in wait
        waiter.acquire()
    KeyboardInterrupt
    
  3. Miro Hrončok reporter

    Running the test manually boils down to:

    >>>> import time
    >>>> time.sleep(3)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: timestamp too large to convert to C _PyTime_t
    >>>
    
  4. mattip

    Something is very wrong. What is "time" (i.e. what happens when you print(time)?

    time.sleep should not be connected at all to _PyTime_t, it is implemented in RPython, the error message seems to point to some CPython type not available in PyPy.

  5. Miro Hrončok reporter
    >>>> import time
    >>>> print(time)
    <module 'time' (built-in)>
    >>>> dir(time)
    ['CLOCK_BOOTTIME', 'CLOCK_MONOTONIC', 'CLOCK_MONOTONIC_COARSE', 'CLOCK_MONOTONIC_RAW', 'CLOCK_PROCESS_CPUTIME_ID', 'CLOCK_REALTIME', 'CLOCK_REALTIME_COARSE', 'CLOCK_THREAD_CPUTIME_ID', '_STRUCT_TM_ITEMS', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'altzone', 'asctime', 'clock', 'clock_getres', 'clock_gettime', 'clock_settime', 'ctime', 'daylight', 'get_clock_info', 'gmtime', 'localtime', 'mktime', 'monotonic', 'perf_counter', 'process_time', 'sleep', 'strftime', 'strptime', 'struct_time', 'time', 'timezone', 'tzname', 'tzset']
    >>>> time.sleep(0.01)
    >>>> time.sleep(0.1)
    >>>> time.sleep(1)
    >>>> time.sleep(2)
    >>>> time.sleep(2.5)
    >>>> time.sleep(3)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: timestamp too large to convert to C _PyTime_t
    >>>> time.sleep(3.)
    >>>> time.sleep(4)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: timestamp too large to convert to C _PyTime_t
    >>>> time.sleep(4.)
    >>>> 
    
  6. Miro Hrončok reporter

    I believe the sec * SECS_TO_NS operation should be called with r_longlongs, but I wouldn't know how to properly check for overflow then:

    result = r_longlong(sec) * SECS_TO_NS
    ... check overflow
    

    But given sec will only be int, there will be no overflow I guess. Will try to patch it.

  7. Log in to comment