Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New shutdown-ipc tests #3508

Merged
merged 1 commit into from Jan 22, 2022
Merged

New shutdown-ipc tests #3508

merged 1 commit into from Jan 22, 2022

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented Jan 19, 2022

Run with:

cabal test cardano-testnet --test-options '-p Spec.Spec.Shutdown'

@newhoggy
Copy link
Contributor Author

This has been happening on Mac in Nix, but runs okay in GH:

          54 ┃   -- Run cardano-node with pipe as stdin.  Use 0 file descriptor as shutdown-ipc
          55 ┃   (mStdin, _mStdout, _mStderr, pHandle, _releaseKey) <- H.createProcess =<<
             ┃   │ CWD: Just "/private/tmp/nix-build-cardano-testnet-test-cardano-testnet-tests-1.33.0-check.drv-0/chairman"
             ┃   │ Command line: /nix/store/y9aaqwb03xf0gj4w63rxg4zfwmj6cd8n-cardano-node-exe-cardano-node-1.33.0/bin/cardano-node run --config /nix/store/imsgqhdsddghhxkmiwzz323m9rhyj6xd-cardano-node-src/configuration/cardano/mainnet-config.json --topology /nix/store/imsgqhdsddghhxkmiwzz323m9rhyj6xd-cardano-node-src/configuration/cardano/mainnet-topology.json --database-path /private/tmp/nix-build-cardano-testnet-test-cardano-testnet-tests-1.33.0-check.drv-0/chairman/test-944b3314754ef365/db --socket-path /private/tmp/nix-build-cardano-testnet-test-cardano-testnet-tests-1.33.0-check.drv-0/chairman/test-944b3314754ef365/node-1-socket --host-addr 127.0.0.1 --port 51932 --shutdown-ipc 0
          56 ┃     ( H.procNode
          57 ┃       [ "run"
          58 ┃       , "--config", projectBase </> "configuration/cardano/mainnet-config.json"
          59 ┃       , "--topology", projectBase </> "configuration/cardano/mainnet-topology.json"
          60 ┃       , "--database-path", tempAbsPath </> "db"
          61 ┃       , "--socket-path", tempAbsPath </> "node-1-socket"
          62 ┃       , "--host-addr", "127.0.0.1"
          63 ┃       , "--port", show @Int port
          64 ┃       , "--shutdown-ipc", "0"
          65 ┃       ] <&>
          66 ┃       ( \cp -> cp
          67 ┃         { IO.std_in = IO.CreatePipe
          68 ┃         , IO.std_out = IO.UseHandle hNodeStdout
          69 ┃         , IO.std_err = IO.UseHandle hNodeStderr
          70 ┃         , IO.cwd = Just tempBaseAbsPath
          71 ┃         }
          72 ┃       )
          73 ┃     )
          74 ┃
          75 ┃   H.threadDelay $ 10 * 1000000
          76 ┃
          77 ┃   mExitCodeRunning <- H.evalIO $ IO.getProcessExitCode pHandle
          78 ┃
          79 ┃   when (isNothing mExitCodeRunning) $ do
          80 ┃     H.evalIO $ IO.hClose hNodeStdout
          81 ┃     H.evalIO $ IO.hClose hNodeStderr
          82 ┃     H.cat nodeStdoutFile
          83 ┃     H.cat nodeStderrFile
          84 ┃
          85 ┃   mExitCodeRunning === Nothing
             ┃   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             ┃   │ ━━━ Failed (- lhs) (+ rhs) ━━━
             ┃   │ - Just (ExitFailure 1)
             ┃   │ + Nothing

@newhoggy newhoggy force-pushed the newhoggy/shutdown-ipc-tests branch 2 times, most recently from 7850afb to 8720562 Compare January 21, 2022 10:40
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -34,6 +35,7 @@ tests = do
, H.testProperty "Spec.Plutus.SubmitApi.TxInLockingPlutus" Spec.Plutus.SubmitApi.TxInLockingPlutus.hprop_plutus
, ignoreOnWindows "Spec.Plutus.Direct.ScriptContextEquality" Spec.Plutus.Direct.ScriptContextEquality.hprop_plutus_script_context_equality
, ignoreOnWindows "Spec.Plutus.Direct.ScriptContextEqualityMint" Spec.Plutus.Direct.ScriptContextEqualityMint.hprop_plutus_script_context_mint_equality
, ignoreOnWindows "Spec.Shutdown" Spec.Shutdown.hprop_shutdown
Copy link
Contributor

@Jimbo4350 Jimbo4350 Jan 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just put a comment saying that currently there is a blocking call on Windows that prevents graceful shutdown (or something to that effect) and that we currently aren't testing the shutdown IPC flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@newhoggy
Copy link
Contributor Author

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 22, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit 4421e29 into master Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants