-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Parallelize test run (extending xUnit) #1863
Comments
Is this the true issue re: #467 ?
but does this imply that pure grain code should execute cleanly in unit tests without a limit on parallelization? |
Not sure I understand what you are asking. But yes, assuming a single grain client and silo cluster, most tests should be able to run in parallel, at least the ones that are within a shared fixture. |
In addition to description at #1682 (comment), here's some more explanation on one potential way to parallalize tests (especially on one way to parallelize tests involving silos). |
@jdom - this one is important. I'm heavily using tests on Orleans with TestClusters, mainly for integration tests. And yeah, it takes long time because currently I can't parallelize them. Another issue is that the bootstrapping of the TestCluster is quite slow, and it's important mainly when debugging a specific test, then you need to wait long time every time you start the debugging process. Thanks |
I believe that now that we have non-static clients, it should be easier to run clusters in parallel, so this might be less of an issue if we can't parallelize the "right way". Slowness of startup is an issue that we are aware, and we would like to provide in the future a way to avoid a lot of ad-hoc scanning of assemblies that are in the deployment directory. In the meantime, one thing that does help a little bit is if you use build-time codegen instead of run-time codegen. |
@jdom - thanks - this helped to reduce my start time from 20 seconds to 16 seconds. This will speed up a bit the debugging process. I'll try installing 1.5.0-rc and play with parallel TestClusters, this can help a lot when running full tests process. Will let you know. |
Awesome, please do let us know. We briefly tried to run our full set of tests, but we got them to stall, but most likely because some of the tests are using statics themselves, as well as messing with Orleans internals that some still use statics. I'm pretty sure you can get better results when testing application level code instead of Orleans internals. |
@sergeybykov pinged me for an update on the current state of this: Currently there is some parallelization in CI via scripts (but not natively in xUnit, so VS or other tooling doesn't take advantage of it). Basically we run each test assembly in a different process in parallel with a small max degree of parallelization. We might easily increase this value by modifying a single line of powershell, given the scheduling changes in Orleans 2.1, where we are no longer consuming so much CPU in the silo while idle. |
Thank you, @jdom. Sounds like there's still quite a bit of work left here. 😊 |
We have some level of parallelism now, via scripts as mentioned above, but also via Xunit's internal parallelization. I believe we could further parallelize, but I'll close this now as it's not really actionable anymore. |
Hi, there's something I wanted to do for a long time, but never find the actual time to do so. Maybe somebody already has the expertise and would like to help out.
Today all of our tests run serially and take a long time. Ideally, once we start an in-memory test cluster, we should be able to run all of the tests that use that test cluster in parallel. Nevertheless, we cannot have 2 test clusters running tests at the same time, mainly because GrainClient relies on statics, so the tests would conflict with each other.
xUnit by default provides the ability to run tests in different test collections in parallel (effectively run all tests within 1 collection serially, but parallelize with running multiple collections concurrently). This is the exact opposite of what we need, as each of our collections are the ones that set up and tear down the cluster and client. So we need to run each test collection serially, but parallelize within it.
The work to support this test execution is not completely trivial, although there are some samples in xUnit's github repo that show how to make changes to it. I have not made an assestment of how much work that is, but here are the hints I got on where to look at (from a Slack chat with them):
Another option is that if we could force each collection to be ran in a separate AppDomain, then at that point we could leverage xUnit's built in parallelization, given that each client will not be conflicting with other collections' usages of GrainClient (and its statics).
The text was updated successfully, but these errors were encountered: