mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-02 13:38:52 +08:00
5e87bf2496
We need to call gc.collect before tearing down our class because we have a cycle between TradingAlgorithm and AlgorithmSimulator which ultimately holds a reference to the pipeline engine passed to the tests here. This means that we're not guaranteed to have deleted our disk-backed resource readers (e.g. SQLiteAdjustmentReader) before trying to delete the tempdir, which causes failures on Windows because Windows doesn't allow you to delete a file if someone still has an open handle to that file. The real fix for this is to break the cycle between TradingAlgorithm and AlgorithmSimulator, but that requires significant breaking API changes.