forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove InMemoryKVParticipantState (digital-asset#4674)
This removes the sample/reference implementation of kvutils InMemoryKVParticipantState. This used to be the only implementation of kvutils, but now with the simplified kvutils api we have ledger-on-memory and ledger-on-sql. InMemoryKVParticipantState was also used for the ledger dump utility, which now uses ledger-on-memory. * Runner now supports a multi participant configuration This change removes the "extra participants" config and goes for consistent participant setup with --participant. * Run all conformance tests in the repository in verbose mode. This means we'll print stack traces on error, which should make it easier to figure out what's going on with flaky tests on CI. This doesn't change the default for other users of the ledger-api-test-tool; we just add the flag for: - ledger-api-test-tool-on-canton - ledger-on-memory - ledger-on-sql - sandbox Fixes digital-asset#4225. CHANGELOG_BEGIN CHANGELOG_END
- Loading branch information
Showing
34 changed files
with
397 additions
and
1,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
bazel_tools/client_server/runner_with_port_check/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) 2020 The DAML Authors. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
load("//bazel_tools:haskell.bzl", "da_haskell_binary") | ||
|
||
da_haskell_binary( | ||
name = "runner", | ||
srcs = ["Main.hs"], | ||
hackage_deps = [ | ||
"base", | ||
"extra", | ||
"process", | ||
"async", | ||
"text", | ||
"safe", | ||
"split", | ||
"network", | ||
"monad-loops", | ||
"safe-exceptions", | ||
], | ||
visibility = ["//visibility:public"], | ||
deps = ["//libs-haskell/da-hs-base"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
-- Copyright (c) 2020 The DAML Authors. All rights reserved. | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
module Main(main) where | ||
|
||
import System.Environment | ||
import Control.Exception.Safe | ||
import Control.Monad.Loops (untilJust) | ||
import System.Process | ||
import Data.List.Split (splitOn) | ||
import Control.Monad (forM_) | ||
import Network.Socket | ||
import Control.Concurrent | ||
|
||
main :: IO () | ||
main = do | ||
[clientExe, clientArgs, serverExe, serverArgs, runnerArgs] <- getArgs | ||
let splitArgs = filter (/= "") . splitOn " " | ||
let serverProc = proc serverExe (splitArgs serverArgs) | ||
let ports :: [Int] = read <$> splitArgs runnerArgs | ||
withCreateProcess serverProc $ \_stdin _stdout _stderr _ph -> do | ||
forM_ ports $ \port -> waitForConnectionOnPort (threadDelay 500000) port | ||
callProcess clientExe (splitArgs clientArgs) | ||
|
||
|
||
waitForConnectionOnPort :: IO () -> Int -> IO () | ||
waitForConnectionOnPort sleep port = do | ||
let hints = defaultHints { addrFlags = [AI_NUMERICHOST, AI_NUMERICSERV], addrSocketType = Stream } | ||
addr : _ <- getAddrInfo (Just hints) (Just "127.0.0.1") (Just $ show port) | ||
untilJust $ do | ||
r <- tryIO $ checkConnection addr | ||
case r of | ||
Left _ -> sleep *> pure Nothing | ||
Right _ -> pure $ Just () | ||
where | ||
checkConnection addr = bracket | ||
(socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)) | ||
close | ||
(\s -> connect s (addrAddress addr)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.