mahmoudimus / nose-timer

A timer plugin for nosetests (how much time does every test take?)
MIT License
126 stars 33 forks source link

Resource temporarily unavailable #44

Closed twiecki closed 9 years ago

twiecki commented 10 years ago
  File "/home/wiecki/envs/zipline_p14/bin/nosetests", line 9, in <module>
    load_entry_point('nose==1.3.3', 'console_scripts', 'nosetests')()
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/core.py", line 121, in __init__
    **extra_args)
  File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/core.py", line 207, in runTests
    result = self.testRunner.run(self.test)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/core.py", line 62, in run
    test(result)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/suite.py", line 223, in run
    test(orig)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/suite.py", line 223, in run
    test(orig)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/suite.py", line 223, in run
    test(orig)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/case.py", line 45, in __call__
    return self.run(*arg, **kwarg)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/case.py", line 138, in run
    result.addError(self, err)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/proxy.py", line 131, in addError
    plugins.addError(self.test, err)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/home/wiecki/envs/zipline_p14/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/home/wiecki/envs/zipline_p14/lib/python2.7/site-packages/nosetimer/plugin.py", line 101, in addError
    self._register_time(test)
  File "/home/wiecki/envs/zipline_p14/lib/python2.7/site-packages/nosetimer/plugin.py", line 97, in _register_time
    self._timed_tests[test.id()] = self._time_taken()
  File "<string>", line 2, in __setitem__
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 755, in _callmethod
    self._connect()
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 742, in _connect
    conn = self._Client(self._token.address, authkey=self._authkey)
  File "/usr/lib/python2.7/multiprocessing/connection.py", line 175, in Client
    answer_challenge(c, authkey)
  File "/usr/lib/python2.7/multiprocessing/connection.py", line 428, in answer_challenge
    message = connection.recv_bytes(256)         # reject large message
IOError: [Errno 11] Resource temporarily unavailable

Not sure why I'm getting this. Could it be related to thread use?

skudriashev commented 10 years ago

Hi, what is case-to-reproduce?

skudriashev commented 9 years ago

Closing this, since no response for a long time.

twiecki commented 9 years ago

Sorry, I haven't run into it since.

skudriashev commented 9 years ago

No problem:)

reallistic commented 9 years ago

Hello, I am running nose-timer for the first time and continue to get this error. I dug into the method and see that its trying to read a local file of some sort. Any idea whats going on?

I should also mention, if I manually run connection.recv_bytes(256) It will occasionally work.

reallistic commented 9 years ago

Turns out this is happening because I am using gevent: http://stackoverflow.com/questions/8678307/gevent-monkeypatching-breaking-multiprocessing/20947384#20947384

skudriashev commented 9 years ago

@mahmoudimus, we now have many issues related to multiprocessing support. We might need to think about going away from multiprocessing lib, but supporting multiprocessing nose plugin. As an option, we can write and share results just via temp files or something? What do you think?

mahmoudimus commented 9 years ago

@skudriashev well, I believe the reason we introduced multiprocessing was to fix https://github.com/mahmoudimus/nose-timer/issues/31 where nose-timer wasn't reporting time when running under multiprocessing. What if we just enable that option when nose is invoked with --processes?

I believe nose checks to see if the configuration has multiprocess_workers to see if it's enabled, so why don't we copy the same check here? Let's keep the default initialization as a normal {} and move this initialization for multiprocessing.Manager().dict() to the configure method and toggle it if we detect that nose-timer is executing under the multiprocessing plugin.

Thoughts?

mahmoudimus commented 9 years ago

reopening issue.

mahmoudimus commented 9 years ago

Actually, going to close this one and create a new one.