-
Notifications
You must be signed in to change notification settings - Fork 112
Speed up smoke tests #2850
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
Open
noonio
wants to merge
2
commits into
master
Choose a base branch
from
speed-up-smoke-test
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Speed up smoke tests #2850
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -107,6 +107,47 @@ mkTestTiming' numDeposits blockTime = | |
| where | ||
| depositPeriod = truncatedDepositPeriod $ fromIntegral numDeposits * 20 * blockTime | ||
|
|
||
| -- | Timing for the smoke test run by the @hydra-cluster@ executable against a | ||
| -- public network, where a block takes ~20s and the run is dominated by waiting | ||
| -- out 'depositActivation' rather than by anything the scenario asserts. | ||
| -- | ||
| -- A deposit becomes active at @created + depositActivation@, where @created@ is | ||
| -- the deposit tx's upper validity bound, set a grace time ahead of the chain | ||
| -- tip by 'Hydra.Chain.Direct.Handlers.draftDepositTx'. That grace time is | ||
| -- @maxGraceTime \`min\` untilDeadline / 2@, and a backticked function binds | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like we should also fix the real code: |
||
| -- tighter than @\/@, so it is @min 200 untilDeadline / 2@: a flat 100s for any | ||
| -- deadline more than 200s out, not the @min 200 (untilDeadline \/ 2)@ it reads | ||
| -- as. So the wait is @100 + depositActivation@, and only the second term is | ||
| -- ours: at one block time it drops from 100 + 400 to 100 + 20. | ||
| -- | ||
| -- 'contestationPeriod' is cut to the point where the close transaction's | ||
| -- validity window stops changing, and no further. The contestation deadline is | ||
| -- @closeTxUpperBound + contestationPeriod@ with the close tx bounded at | ||
| -- @now + min contestationPeriod maxGraceTime@, so at @10 * blockTime@ = 200s | ||
| -- the wait halves from 600s to 400s while that @min@ still yields 200s, exactly | ||
| -- as it does at 'mkTestTiming'\'s 400s. Going below 200s would start shortening | ||
| -- the window every close, contest and increment has to be included in, with no | ||
| -- resubmit on expiry, and would drag two things with it: the derived | ||
| -- @unsyncedPeriod@ (half the contestation period, against a Blockfrost follower | ||
| -- that only observes blocks with a successor and so lags a block gap by | ||
| -- construction) and 'Hydra.Chain.Blockfrost.Client.submissionRetryPolicy', | ||
| -- whose ~180s worst case is documented against a 200s window. | ||
| -- | ||
| -- 'depositPeriod' keeps its 'mkTestTiming' value. It is not on the critical | ||
| -- path -- it sets how long a deposit stays active, not how long anything waits | ||
| -- -- and shortening it only eats that window, which is | ||
| -- @depositPeriod - graceTime@. NOTE: This assumes block times around 20s; the | ||
| -- window closes entirely below ~5s, where 'depositPeriod' falls to the flat | ||
| -- 100s grace time. 'Test.Hydra.Cluster.UtilSpec' guards the value used here. | ||
| mkSmokeTiming :: BlockTime -> Timing | ||
| mkSmokeTiming blockTime = | ||
| Timing | ||
| { blockTime | ||
| , contestationPeriod = truncate $ max 1 (10 * blockTime) | ||
| , depositPeriod = truncatedDepositPeriod $ max 1 (20 * blockTime) | ||
| , depositActivation = truncatedDepositPeriod $ max 1 blockTime | ||
| } | ||
|
|
||
| -- | Get a timeout until a deposit should have happened given a 'Timing'. A | ||
| -- deposit becomes active after 'depositActivation' and then needs about one | ||
| -- 'depositPeriod' to be picked up and incremented, so both are accounted for | ||
|
|
||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also add some code to squash all of faucet utxo into one after seeding. There could be many smaller outputs which we should be able to use for seeding too.