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

how do I run parallel mode via API? #312

Closed
nedbat opened this issue Jun 12, 2014 · 6 comments
Closed

how do I run parallel mode via API? #312

nedbat opened this issue Jun 12, 2014 · 6 comments
Labels
bug Something isn't working combine

Comments

@nedbat
Copy link
Owner

nedbat commented Jun 12, 2014

Originally reported by Anonymous


My flow goes like this:

  cov = coverage.coverage(data_suffix=True)
  cov.start()
  suite = unittest.defaultTestLoader.discover(...)
  suite = ConcurrentTestSuite(suite, fork_for_tests(4))  # os.fork 4 subprocesses
  unittest.TextTestRunner().run(suite)
  cov.stop()
  cov.combine()
  cov.save()

My suite does a lot of forks (via http://coreygoldberg.blogspot.com/2013/06/python-concurrencytest-running.html).

I thought setting data_suffix=True would force the parallel runs, yet I get different coverage results depending if I os.fork the runs or not.


@nedbat
Copy link
Owner Author

nedbat commented Jun 12, 2014

Can you provide a small sample project that demonstrates the problem? (Even a large project that demonstrates the problem would be good.)

@nedbat
Copy link
Owner Author

nedbat commented Jun 13, 2014

Original comment by Albert Ting (Bitbucket: altlist, GitHub: Unknown)


Attached is an example.

#!bash

$ run_tests --parallel=1    -> 100% coverage
$ run_tests --parallel=10  ->  35% coverage

@nedbat
Copy link
Owner Author

nedbat commented Jul 7, 2014

Original comment by Albert Ting (Bitbucket: altlist, GitHub: Unknown)


Hi, are there any updates?

@nedbat
Copy link
Owner Author

nedbat commented Jul 8, 2014

Thanks, I've reproduced it, and will dig in soon to understand what's going wrong.

@nedbat
Copy link
Owner Author

nedbat commented Jul 10, 2014

@altlist This seems to be a duplicate of #310, os.fork and os._exit.

@nedbat
Copy link
Owner Author

nedbat commented Jul 10, 2014

Duplicate of #310.

@nedbat nedbat closed this as completed Jul 10, 2014
@nedbat nedbat added major bug Something isn't working combine labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working combine
Projects
None yet
Development

No branches or pull requests

1 participant