Skip to content

Commit e9797f2

Browse files
committed
Timeout removePathForcibly in moduleWorkspace
1 parent 10862a4 commit e9797f2

File tree

78 files changed

+372
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+372
-215
lines changed

cardano-cli/cardano-cli.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ library cardano-cli-test-lib
320320
Test.Cardano.CLI.Aeson
321321
Test.Cardano.CLI.Hash
322322
Test.Cardano.CLI.Util
323+
Test.Cardano.CLI.Workspace
323324

324325
build-depends:
325326
aeson,
@@ -340,6 +341,7 @@ library cardano-cli-test-lib
340341
network,
341342
process,
342343
resourcet,
344+
temporary,
343345
text,
344346
utf8-string,
345347
vector,

cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/SigningKeys.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import Control.Monad (void)
2727
import Data.ByteString.Lazy qualified as LB
2828

2929
import Test.Cardano.CLI.Util
30+
import Test.Cardano.CLI.Workspace
3031

3132
import Hedgehog (Property, property, success)
3233
import Hedgehog qualified as H
33-
import Hedgehog.Extras.Test.Base qualified as H
3434
import Hedgehog.Internal.Property (failWith)
3535

3636
hprop_deserialise_legacy_signing_Key :: Property
@@ -107,7 +107,7 @@ hprop_generate_and_read_nonlegacy_signingkeys =
107107

108108
hprop_migrate_legacy_to_nonlegacy_signingkeys :: Property
109109
hprop_migrate_legacy_to_nonlegacy_signingkeys =
110-
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
110+
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
111111
let legKeyFp = "test/cardano-cli-golden/files/input/byron/keys/legacy.skey"
112112
nonLegacyKeyFp <- noteTempFile tempDir "nonlegacy.skey"
113113

cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import Data.ByteString (ByteString)
1111
import GHC.Stack
1212

1313
import Test.Cardano.CLI.Util
14+
import Test.Cardano.CLI.Workspace
1415

1516
import Hedgehog (MonadTest, Property, (===))
16-
import Hedgehog.Extras.Test.Base qualified as H
1717
import Hedgehog.Internal.Property (failWith)
1818

1919
{- HLINT ignore "Use camelCase" -}
2020

2121
hprop_byronTx_legacy :: Property
2222
hprop_byronTx_legacy =
23-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
23+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
2424
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/legacy.skey"
2525
expectedTx <- noteInputFile "test/cardano-cli-golden/files/input/byron/tx/legacy.tx"
2626
createdTx <- noteTempFile tempDir "tx"
@@ -45,7 +45,7 @@ hprop_byronTx_legacy =
4545

4646
hprop_byronTx :: Property
4747
hprop_byronTx =
48-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
48+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
4949
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
5050
expectedTx <- noteInputFile "test/cardano-cli-golden/files/input/byron/tx/normal.tx"
5151
createdTx <- noteTempFile tempDir "tx"

cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/UpdateProposal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Cardano.CLI.Byron.UpdateProposal
77
import RIO
88

99
import Test.Cardano.CLI.Util
10+
import Test.Cardano.CLI.Workspace
1011

1112
import Hedgehog (Property, (===))
12-
import Hedgehog.Extras.Test.Base qualified as H
1313

1414
{- HLINT ignore "Use camelCase" -}
1515

1616
hprop_byron_update_proposal :: Property
1717
hprop_byron_update_proposal =
18-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
18+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
1919
expectedUpdateProposal <- noteInputFile "test/cardano-cli-golden/files/input/byron/update-proposal"
2020
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
2121
createdUpdateProposal <- noteTempFile tempDir "byron-update-proposal"

cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Vote.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Cardano.CLI.Byron.Vote
77
import RIO
88

99
import Test.Cardano.CLI.Util
10+
import Test.Cardano.CLI.Workspace
1011

1112
import Hedgehog (Property, (===))
12-
import Hedgehog.Extras.Test.Base qualified as H
1313

1414
{- HLINT ignore "Use camelCase" -}
1515

1616
hprop_byron_yes_vote :: Property
1717
hprop_byron_yes_vote =
18-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
18+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
1919
expectedYesVote <- noteInputFile "test/cardano-cli-golden/files/input/byron/votes/vote-yes"
2020
proposal <- noteInputFile "test/cardano-cli-golden/files/input/byron/update-proposal"
2121
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
@@ -43,7 +43,7 @@ hprop_byron_yes_vote =
4343

4444
hprop_byron_no_vote :: Property
4545
hprop_byron_no_vote =
46-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
46+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
4747
expectedNoVote <- noteInputFile "test/cardano-cli-golden/files/input/byron/votes/vote-no"
4848
proposal <- noteInputFile "test/cardano-cli-golden/files/input/byron/update-proposal"
4949
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"

cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/Assemble.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Test.Golden.Conway.Transaction.Assemble where
55
import Control.Monad (void)
66

77
import Test.Cardano.CLI.Util
8+
import Test.Cardano.CLI.Workspace
89

910
import Hedgehog (Property)
1011
import Hedgehog.Extras.Test qualified as H
@@ -15,7 +16,7 @@ import Hedgehog.Extras.Test qualified as H
1516

1617
hprop_golden_conway_transaction_assemble_witness_signing_key :: Property
1718
hprop_golden_conway_transaction_assemble_witness_signing_key =
18-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
19+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
1920
witnessTx <- noteTempFile tempDir "single-signing-key-witness-tx"
2021
txBodyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/txbody"
2122
signingKeyWitnessFile <-

cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/BuildRaw.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Data.List (isInfixOf)
77
import System.Exit (ExitCode (..))
88

99
import Test.Cardano.CLI.Util
10+
import Test.Cardano.CLI.Workspace
1011

1112
import Hedgehog
1213
import Hedgehog qualified as H
@@ -18,7 +19,7 @@ import Hedgehog.Extras.Test qualified as H
1819
-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw treasury donation/"'@
1920
hprop_golden_conway_build_raw_treasury_donation :: Property
2021
hprop_golden_conway_build_raw_treasury_donation =
21-
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
22+
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
2223
let goldenFile = "test/cardano-cli-golden/files/golden/conway/build-raw-out.tx"
2324

2425
-- Key filepaths
@@ -53,7 +54,7 @@ hprop_golden_conway_build_raw_treasury_donation =
5354
-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw donation no current treasury value/"'@
5455
hprop_golden_conway_build_raw_donation_no_current_treasury_value :: Property
5556
hprop_golden_conway_build_raw_donation_no_current_treasury_value =
56-
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
57+
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
5758
-- Key filepaths
5859
outFile <- noteTempFile tempDir "out.json"
5960

@@ -86,7 +87,7 @@ hprop_golden_conway_build_raw_donation_no_current_treasury_value =
8687
-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw donation no treasury donation/"'@
8788
hprop_golden_conway_build_raw_donation_no_treasury_donation :: Property
8889
hprop_golden_conway_build_raw_donation_no_treasury_donation =
89-
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
90+
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
9091
-- Key filepaths
9192
outFile <- noteTempFile tempDir "out.json"
9293

cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/CreateWitness.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Test.Golden.Conway.Transaction.CreateWitness where
55
import Control.Monad (void)
66

77
import Test.Cardano.CLI.Util
8+
import Test.Cardano.CLI.Workspace
89

910
import Hedgehog (Property)
1011
import Hedgehog.Extras.Test qualified as H
@@ -20,7 +21,7 @@ txOut =
2021

2122
hprop_golden_shelley_transaction_signing_key_witness :: Property
2223
hprop_golden_shelley_transaction_signing_key_witness =
23-
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
24+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
2425
txBodyOutFile <- noteTempFile tempDir "tx-body-out"
2526

2627
-- Create tx body file

cardano-cli/test/cardano-cli-golden/Test/Golden/CreateStaked.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import System.Directory
1212
import System.FilePath
1313

1414
import Test.Cardano.CLI.Util (execCardanoCLI, watchdogProp)
15+
import Test.Cardano.CLI.Workspace
1516

1617
import Hedgehog (Property)
1718
import Hedgehog qualified as H
18-
import Hedgehog.Extras (moduleWorkspace, propertyOnce)
19+
import Hedgehog.Extras (propertyOnce)
1920
import Hedgehog.Extras qualified as H
2021

2122
{- HLINT ignore "Use camelCase" -}
@@ -33,7 +34,7 @@ tree root = do
3334

3435
hprop_golden_create_staked :: Property
3536
hprop_golden_create_staked =
36-
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
37+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
3738
let alonzo = "genesis.alonzo.spec.json"
3839
conway = "genesis.conway.spec.json"
3940
networkMagic = 42

cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ import System.FilePath
1919

2020
import Test.Cardano.CLI.Aeson
2121
import Test.Cardano.CLI.Util (execCardanoCLI, watchdogProp)
22+
import Test.Cardano.CLI.Workspace
2223

2324
import Hedgehog (Property)
2425
import Hedgehog qualified as H
25-
import Hedgehog.Extras (moduleWorkspace, propertyOnce)
26+
import Hedgehog.Extras (propertyOnce)
2627
import Hedgehog.Extras qualified as H
2728

2829
{- HLINT ignore "Redundant bracket" -}
@@ -105,7 +106,7 @@ golden_create_testnet_data
105106
-- ^ The path to the shelley template use, if any
106107
-> Property
107108
golden_create_testnet_data mShelleyTemplate =
108-
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
109+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
109110
let outputDir = tempDir </> "out"
110111
templateArg :: [String] =
111112
case mShelleyTemplate of
@@ -159,7 +160,7 @@ golden_create_testnet_data mShelleyTemplate =
159160
-- @cabal test cardano-cli-golden --test-options '-p "/golden create testnet data deleg non deleg/"'@
160161
hprop_golden_create_testnet_data_deleg_non_deleg :: Property
161162
hprop_golden_create_testnet_data_deleg_non_deleg =
162-
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
163+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
163164
let outputDir = tempDir </> "out"
164165
totalSupply :: Int = 2_000_000_000_000 -- 2*10^12
165166
delegatedSupply :: Int = 500_000_000_000 -- 5*10^11, i.e. totalSupply / 4
@@ -205,7 +206,7 @@ hprop_golden_create_testnet_data_deleg_non_deleg =
205206
-- is not specified. It was broken in the past (see https://github.com/IntersectMBO/cardano-node/issues/5953).
206207
hprop_golden_create_testnet_data_shelley_genesis_output :: Property
207208
hprop_golden_create_testnet_data_shelley_genesis_output =
208-
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
209+
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
209210
vanillaShelleyGenesis :: ShelleyGenesis <-
210211
H.readJsonFileOk "test/cardano-cli-golden/files/input/shelley/genesis/genesis.spec.json"
211212
let tweakedValue = 3_123_456_000_000

0 commit comments

Comments
 (0)