-
Notifications
You must be signed in to change notification settings - Fork 375
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
test(bug): txtar to reproduce the VM hanging during Render #1736
Open
jefft0
wants to merge
10
commits into
gnolang:master
Choose a base branch
from
jefft0:chore/add-cpu-cycle-overrun1.txtar
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
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
83d99a2
chore: Add cpu-cycle-overrun1.txtar . See the PR.
jefft0 2f78ae2
chore: In integration setupGnolandTestScript, use strconv.Unquote on …
jefft0 c3334ee
Revert "chore: In integration setupGnolandTestScript, use strconv.Unq…
jefft0 e67f566
Merge branch 'master' into chore/add-cpu-cycle-overrun1.txtar
jefft0 3f76ee2
Merge branch 'master' into chore/add-cpu-cycle-overrun1.txtar
jefft0 f9d9479
Merge branch 'master' into chore/add-cpu-cycle-overrun1.txtar
jefft0 87a9e5f
Merge branch 'master' into chore/add-cpu-cycle-overrun1.txtar
jefft0 ff00c55
chore: In cpu-cycle-overrun1.txtar, use the new gnokey query syntax
jefft0 a4ea975
Merge branch 'master' into chore/add-cpu-cycle-overrun1.txtar
jefft0 bc9f816
Merge branch 'master' into chore/add-cpu-cycle-overrun1.txtar
thehowl 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 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,64 @@ | ||
loadpkg gno.land/p/demo/avl | ||
|
||
# start a new node | ||
gnoland start | ||
|
||
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/cpu_cycle_overrun1 -gas-fee 1ugnot -gas-wanted 100000000 -broadcast -chainid=tendermint_test test1 | ||
stdout OK! | ||
|
||
# Call AddData 3 times | ||
gnokey maketx call -pkgpath gno.land/r/cpu_cycle_overrun1 -func AddData -gas-fee 1ugnot -gas-wanted 100000000 -broadcast -chainid=tendermint_test test1 | ||
stdout OK! | ||
gnokey maketx call -pkgpath gno.land/r/cpu_cycle_overrun1 -func AddData -gas-fee 1ugnot -gas-wanted 100000000 -broadcast -chainid=tendermint_test test1 | ||
stdout OK! | ||
gnokey maketx call -pkgpath gno.land/r/cpu_cycle_overrun1 -func AddData -gas-fee 1ugnot -gas-wanted 100000000 -broadcast -chainid=tendermint_test test1 | ||
stdout OK! | ||
|
||
# Call AddData one more time. The call to Render hangs. If you comment this out, then the call to Render returns quickly. | ||
gnokey maketx call -pkgpath gno.land/r/cpu_cycle_overrun1 -func AddData -gas-fee 1ugnot -gas-wanted 100000000 -broadcast -chainid=tendermint_test test1 | ||
stdout OK! | ||
|
||
# Call Render | ||
gnokey query vm/qrender --data "gno.land/r/cpu_cycle_overrun1\n" | ||
|
||
-- cpu_cycle_overrun1.gno -- | ||
package cpu_cycle_overrun1 | ||
|
||
import ( | ||
"strconv" | ||
"time" | ||
|
||
"gno.land/p/demo/avl" | ||
) | ||
|
||
var gData = avl.Tree{} // id -> string | ||
|
||
type MyData struct { | ||
data avl.Tree | ||
} | ||
|
||
// Add a lot of data to gData (as much as we can do with the given maximum gas allowed). | ||
func AddData() { | ||
for i := 1; i <= 1000; i++ { | ||
gData.Set(strconv.Itoa(gData.Size()), "hello") | ||
} | ||
} | ||
|
||
func Render(path string) string { | ||
// Put the data in allData. | ||
subdata := &MyData{data: gData} | ||
allData := avl.Tree{} | ||
gData.Iterate("", "", func(key string, postI interface{}) bool { | ||
allData.Set(strconv.Itoa(allData.Size()), subdata) | ||
return false | ||
}) | ||
|
||
// Iterate allData and make the render string. | ||
now := time.Now() | ||
str := "" | ||
allData.Iterate("", "", func(key string, dataI interface{}) bool { | ||
str += now.Format("2006-01-02 3:04pm MST") | ||
return false | ||
}) | ||
return "len " + strconv.Itoa(len(str)) | ||
} |
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.
Can we run this txtar conditionally, so it doesn't hang in the local suite, but is present in the codebase? cc @gfanton
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.
We should not have failing tests in the codebase unless we have a system that expects them to fail and checks that they are still failing
Ie. what we should do for the "challenges" directory
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 added the "bug" label so that this PR gets attention as demonstrating a bug.