Page MenuHomeElementl

Speed up test runs by using all CPU cores

Authored by rexledesma on Jun 1 2021, 6:23 PM.
Referenced Files
Unknown Object (File)
Wed, Mar 15, 1:54 AM
Unknown Object (File)
Fri, Mar 10, 9:05 PM
Unknown Object (File)
Feb 14 2023, 10:55 PM
Unknown Object (File)
Feb 14 2023, 8:06 PM
Unknown Object (File)
Feb 14 2023, 6:20 PM
Unknown Object (File)
Feb 14 2023, 1:13 PM
Unknown Object (File)
Feb 14 2023, 11:11 AM
Unknown Object (File)
Feb 14 2023, 10:54 AM

Diff Detail

R1 dagster
rl/test-speedup (branched from master)
No Lint Coverage
No Test Coverage

Event Timeline

dgibson added a subscriber: max.

@max has tried this before, and we had to revert it due to increased flakiness. It does seem to have worked here though, so maybe unrelated fixes have fixed the flakiness?

let's kick off some more runs just to see how this holds up against flakiness. was honestly expecting more of an performance gain - current tests are running at around 20-23m and this went to 19m. not a bad win, but will probably need to apply this to all tox.ini files

probably need to apply this to all tox.ini files

the long poll of the build suite is core_tests which depends on the step to build the test image. I am not sure why core depends on the test image build where most of the other tests do not.

This diff would get us ~15% speed up for low effort assuming its stable, though it looks like we caught 1 failure 6 runs.

To get the total test suite time down, I think getting the subset of core_tests that need the test image in to their own test suite could go a long way

yeah I think the failure in is representative of last time we tried this unfortunately. It kind of makes sense that tests that involve processes and interrupts would interfere with each other sometimes when running in different threads in the same process.

I think one thing we could do is take tests that depend on spinning up subprocesses or threads and move those into integration_tests, and be more aggro about what we run on every diff as fast unit tests (trading off completeness for test speed basically). Most of dagster-graphql should probably be considered an integration test, for example, and the tests in that failure that spin up actual gRPC subprocesses probably should be considered integration tests. That's a much bigger overhaul though. A lot of those tests probably overlap with the top slowest tests in alex's other diff thuogh.

This revision now requires changes to proceed.Jun 1 2021, 8:01 PM

This definitely looks cleaner than the last time I tried it. I'd want to see ~100 test runs succeed before approving this. The failure above might be due to a conflict with the GRPC generation test, test_compiled_protobuf, which could definitely be isolated but is definitely not isolated at present. As you've discovered, the big wins in test time will come from more intelligent use of fixtures and from writing more true unit tests, not from multiprocessing.

Back to the drawing table on this one