mahmoudimus / nose-timer

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

v0.5 is broken on MacOs #68

Closed dmakhno closed 8 years ago

dmakhno commented 8 years ago

https://docs.python.org/2/library/multiprocessing.html#multiprocessing.Queue.qsize

Note that this may raise NotImplementedError on Unix platforms like Mac OS X where sem_getvalue() is not implemented.

I got

  File "/Users/user/Projects/vermilion/venv/lib/python2.7/site-packages/nosetimer/plugin.py", line 96, in report
    for i in range(_results_queue.qsize()):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 143, in qsize
    return self._maxsize - self._sem._semlock._get_value()

It used to work perfectly with multiprocessing and xunitmp with mac, centos and ubuntu, now it fails totally and have to roll back to 0.4.4

dmakhno commented 8 years ago

@skudriashev, I cannot contribute to fix, I don't quite understand the diff

mahmoudimus commented 8 years ago

@dmakhno I will take a look when I get a chance. Is this blocking you now?

dmakhno commented 8 years ago

@mahmoudimus, Thanks... I reverted back to 0.4.4, it works absolutely fine for me since I don't have windows at all, and as I understand support of windows in 0.5 broken this.

skudriashev commented 8 years ago

@dmakhno, this change was done to make multiprocessing nose plugin work with timer plugin. There is nothing about Windows.

skudriashev commented 8 years ago

@dmakhno, btw, please look the the comment: "# Windows and Python 2.7 multiprocessing don't marry well.", so we need to check that we are not on Windows. Perhaps we need to skip Mac OS too.

skudriashev commented 8 years ago

@dmakhno, do you run the nose-timer with multiprocessing plugin?

dmakhno commented 8 years ago

@skudriashev, yes, 0.4.4 works just as fine. Here is jenkins image

These are example integration tests and pretty heavy with timing, but works as a charm. And again 0.4.4. Oh, need to mention ALL tests are written as xUnit (grouped by suites via TestCase)

skudriashev commented 8 years ago

@dmakhno, right, you use the multiprocessing plugin. So need to fix. Will do when possible.

skudriashev commented 8 years ago

Hi, @dmakhno! I've implemented fix for MacOs in the max-os-fix branch (https://github.com/mahmoudimus/nose-timer/tree/mac-os-fix). Could you, please, try it to check if this fixes your issue. Thanks.

matclayton commented 8 years ago

We're seeing the same issue, and this branch fixed it for us, any chance of releasing it to pipy?

mahmoudimus commented 8 years ago

@matclayton thanks for the feedback. we've made a pull request here #71 and we'll publish to pypi shortly.

mahmoudimus commented 8 years ago

@matclayton can you pull v 0.6.0 from pypi and confirm that it works for you?

matclayton commented 8 years ago

Have done, and it does :)

On 11 February 2016 at 19:23, Mahmoud Abdelkader notifications@github.com wrote:

@matclayton https://github.com/matclayton can you pull v 0.6.0 from pypi and confirm that it works for you?

— Reply to this email directly or view it on GitHub https://github.com/mahmoudimus/nose-timer/issues/68#issuecomment-183020415 .

Matthew Clayton | Co-Founder Mixcloud Limited

mixcloud http://www.mixcloud.com/mat twitter http://www.twitter.com/matclayton

email mat@mixcloud.com mobile +44 7872007851 skype matclayton

mahmoudimus commented 8 years ago

@matclayton :+1: thanks for reporting!

@dmakhno you may want to try this as well. let us know how it goes :)