How to parallelize assets testing in pytest ? #17930
-
Hello, I would like to have more information about the correct way to use multiprocessing in pytest for dagster assets. I am currently trying to parallelize 3 unit tests which each assert the result of an asset polling an API. They have no dependencies to each other and can run in parallel. The processing time is quite long (roughly 5 minutes per test) as we have to wait for the API to process files, and it is the main bottleneck for CI completion. Materialize to memory approach
However, the assets are still run sequentially. Temporary reconstructable job approach
The issue here is that I can't see how I can declare this job in the DagsterInstance ? Would it be a good approach to run the 3 assets in parallel ? Thanks for your help ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Materialize to memory approach If the assets are independent and I/O bound instead of compute bound, you can run the
Temporary reconstructable job approach So the rules for
|
Beta Was this translation helpful? Give feedback.
Materialize to memory approach
If the assets are independent and I/O bound instead of compute bound, you can run the
materialize_to_memory
calls for each asset in threads for concurrency. Something like this:Temporary reconstructable job approach
So the rules for
reconstructable
are just that it has to …