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

[GnoVM] Inconsistent testing times on the same code #3514

Open
leohhhn opened this issue Jan 14, 2025 · 1 comment
Open

[GnoVM] Inconsistent testing times on the same code #3514

leohhhn opened this issue Jan 14, 2025 · 1 comment

Comments

@leohhhn
Copy link
Contributor

leohhhn commented Jan 14, 2025

Description

When running gno test . -v on code, for example in the r/demo/counter directory, test times differ between executions:

r/demo/counter on  master [$] 
❯ gno test . -v      
=== RUN   TestIncrement
--- PASS: TestIncrement (0.00s)
=== RUN   TestRender
--- PASS: TestRender (0.00s)
ok      .       0.84s

r/demo/counter on  master [$] 
❯ gno test . -v
=== RUN   TestIncrement
--- PASS: TestIncrement (0.00s)
=== RUN   TestRender
--- PASS: TestRender (0.00s)
ok      .       0.81s

r/demo/counter on  master [$] 
❯ gno test . -v
=== RUN   TestIncrement
--- PASS: TestIncrement (0.00s)
=== RUN   TestRender
--- PASS: TestRender (0.00s)
ok      .       0.82s

Not sure why this is happening, or if it should happen, especially since there is not parallelism or concurrency involved.

Anyways, this might be replaced by the amount of gas consumed instead, which is a more useful metric: #2467

Any ideas @mvertes @thehowl?

@thehowl
Copy link
Member

thehowl commented Jan 14, 2025

Most of the computation time goes into loading standard libraries and other packages required by the package being tested. The time will be inconsistent due to varying factors on the machine, like disk access times, so there will be some small differences; but as exist in go and as in most computation.

Ideally, we'd separate the test execution time from the time to load the imports; this could be done, and could make the numbers add up correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

2 participants