Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
92 stars 50 forks source link

Can't run multiple Plutip clusters as kupos share the same `%TMP%/kupo-db` directory #1570

Closed Renegatto closed 4 months ago

Renegatto commented 9 months ago

Currently when we attempt to run multiple Plutip clusters in parallel contracts fail with No utxos found.

The issue is in these lines:

startKupo cfg params = do
  tmpDir <- liftEffect tmpdir
  let
    workdir = tmpDir <</>> "kupo-db"

workdir will be the same for all kupo instances being run in the same test suite. Fix is simple - generate random kupo temp dir every time like this:

startKupo cfg params = do
  tmpDir <- liftEffect tmpdir
  workdir <- liftEffect $ (tmpDir <</>> _) <$> uniqueId "kupo-db"
klntsky commented 9 months ago

Thanks! I would approve a PR.

Renegatto commented 5 months ago

@klntsky here it is, please review: #1605