mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 17:28:46 +03:00
3554596f9a
This fixes all flakiness in `damlc test` that I was able to reproduce. Previously, I got it to fail in about 10% of the cases whereas now I have successfully run tests 200 times under load without issues. There were two issues at play here: 1. We run scenarios in separate threads to be able to kill the running Shake session quickly even if a scenario has an infinite loop or something like that (there is a timeout but it’s quite long). This could result in one of those left-over threads trying to issue a request while we are already trying to shut down. To fix that, we wait for the concurrency semaphore to be empty before shutting down. 2. Just waiting for scenario executions is not quite sufficient as `runAction` does not wait for all rules to finish (we could just use runActionSync in `damlc test` but I’d rather make this work properly). While we do wait for all scenario executions to finish there is one gRPC request in offInterest that we do not wait for: gcCtxs. To fix this, I’ve now routed all gRPC requests through the semaphore which means that we will also wait for these requests to finish (or prevent them from spawning). This makes more sense anyway as scenario executions are mostly fairly cheap requests while things like setting up the context are expensive so we want to limit their concurrency. We should make the concurrency limit configurable but I’ll leave that for a separate PR. |
||
---|---|---|
.. | ||
client | ||
protos | ||
server |