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
[3.5] test_first_completed_some_already_completed() of test_concurrent_futures.ProcessPoolWaitTests: time.sleep() fails with "sleep length must be non-negative" in setUp() on x86 Tiger 3.5 #75028
Comments
Code of the setUp() method: class ExecutorMixin:
worker_count = 5
def setUp(self):
self.t1 = time.time()
try:
self.executor = self.executor_type(max_workers=self.worker_count)
except NotImplementedError as e:
self.skipTest(str(e))
self._prime_executor()
def _prime_executor(self):
# Make sure that the executor is ready to do work before running the
# tests. This should reduce the probability of timeouts in the tests.
futures = [self.executor.submit(time.sleep, 0.1)
for _ in range(self.worker_count)]
for f in futures:
f.result() I don't understand how the child process can fail with ValueError("sleep length must be non-negative") when running time.sleep(0.1). Code of the sleep function: static PyObject *
time_sleep(PyObject *self, PyObject *obj)
{
_PyTime_t secs;
if (_PyTime_FromSecondsObject(&secs, obj, _PyTime_ROUND_CEILING))
return NULL;
if (secs < 0) {
PyErr_SetString(PyExc_ValueError,
"sleep length must be non-negative");
return NULL;
}
if (pysleep(secs) != 0)
return NULL;
Py_INCREF(Py_None);
return Py_None;
} Can it be a major rounding issue in time_sleep()? Or concurrent.futures failed completely to serialized the floating point number 0.1? http://buildbot.python.org/all/builders/x86%20Tiger%203.5/builds/324/steps/test/logs/stdio 0:27:59 load avg: 1.54 [211/398/1] test_concurrent_futures ====================================================================== concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
ValueError: sleep length must be non-negative
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/test/test_concurrent_futures.py", line 71, in setUp
self._prime_executor()
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/test/test_concurrent_futures.py", line 87, in _prime_executor
f.result()
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/concurrent/futures/_base.py", line 398, in result
return self.__get_result()
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/concurrent/futures/_base.py", line 357, in __get_result
raise self._exception
ValueError: sleep length must be non-negative Ran 71 tests in 65.994s FAILED (errors=1) |
Python 3.5 doesn't accept bugfixes anymore, so I close this issue. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: