mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
Fix trigger compat test for canton sandbox (#12549)
This fixes the timeout on trigger compat tests for the new sandbox (with LF >= 1.14). The issue was that the trigger was "readAs"-ing with a party that doesn't exist, since party ids aren't predictable with the new sandbox. The solution is to allocate the Alice party ahead of time, and then pass the allocated party in when calling `daml trigger`. changelog_begin changelog_end
This commit is contained in:
parent
3ea8aded13
commit
8692d80b33
@ -144,10 +144,21 @@ canonicalize_rlocation() {{
|
||||
runner=$$(canonicalize_rlocation $(rootpath {runner}))
|
||||
# Cleanup the trigger runner process but maintain the script runner exit code.
|
||||
trap 'status=$$?; kill -TERM $$PID; wait $$PID; exit $$status' INT TERM
|
||||
|
||||
SCRIPTOUTPUT=$$(mktemp -d)
|
||||
$$runner script \\
|
||||
--ledger-host localhost \\
|
||||
--ledger-port 6865 \\
|
||||
--wall-clock-time \\
|
||||
--dar $$(canonicalize_rlocation $(rootpath {dar})) \\
|
||||
--script-name TestScript:allocateAlice \\
|
||||
--output-file $$SCRIPTOUTPUT/alice.json
|
||||
ALICE=$$(cat $$SCRIPTOUTPUT/alice.json | sed 's/"//g')
|
||||
rm -rf $$SCRIPTOUTPUT
|
||||
$$runner trigger \\
|
||||
--ledger-host localhost \\
|
||||
--ledger-port 6865 \\
|
||||
--ledger-party Alice \\
|
||||
--ledger-party $$ALICE \\
|
||||
--wall-clock-time \\
|
||||
--dar $$(canonicalize_rlocation $(rootpath {dar})) \\
|
||||
--trigger-name CopyTrigger:copyTrigger &
|
||||
|
@ -8,10 +8,24 @@ import DA.Assert
|
||||
import DA.Time
|
||||
import Daml.Script
|
||||
|
||||
allocateAlice : Script Party
|
||||
allocateAlice = do
|
||||
debug "Creating Alice ..."
|
||||
alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice")
|
||||
debug alice
|
||||
debug "... done"
|
||||
pure alice
|
||||
|
||||
test : Script ()
|
||||
test = do
|
||||
debug "Creating parties ..."
|
||||
alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice")
|
||||
debug "Searching for Alice ..."
|
||||
let isAlice x = displayName x == Some "Alice"
|
||||
Some aliceDetails <- find isAlice <$> listKnownParties
|
||||
let alice = party aliceDetails
|
||||
debug alice
|
||||
debug "... done"
|
||||
|
||||
debug "Creating Bob ..."
|
||||
bob <- allocatePartyWithHint "Bob" (PartyIdHint "Bob")
|
||||
debug alice
|
||||
debug bob
|
||||
|
Loading…
Reference in New Issue
Block a user