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

test: add additional hbar limiter tests #2697

Merged
merged 16 commits into from
Jul 25, 2024

Conversation

georgi-l95
Copy link
Collaborator

@georgi-l95 georgi-l95 commented Jul 12, 2024

Description:
This PR adds aditional positive and negative scenarios for the HBar limiter acceptance test.
I've also set the limit for the suite to 300000000 tinybars, this is just enough so that one contract deploy with fileCreate can pass and next one with fileCreate and fileAppend will fail.

Related issue(s):

Fixes #2696

Fixes #2703

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
@georgi-l95 georgi-l95 added the enhancement New feature or request label Jul 12, 2024
@georgi-l95 georgi-l95 added this to the 0.52.0 milestone Jul 12, 2024
@georgi-l95 georgi-l95 self-assigned this Jul 12, 2024
@georgi-l95 georgi-l95 linked an issue Jul 12, 2024 that may be closed by this pull request
@georgi-l95 georgi-l95 marked this pull request as draft July 12, 2024 10:17
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Copy link

github-actions bot commented Jul 12, 2024

Tests

    2 files  161 suites   11s ⏱️
867 tests 866 ✔️ 1 💤 0
880 runs  879 ✔️ 1 💤 0

Results for commit dd7d850.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 12, 2024

Acceptance Tests

  21 files  246 suites   35m 45s ⏱️
609 tests 603 ✔️ 4 💤 2
864 runs  856 ✔️ 4 💤 4

Results for commit dd7d850.

♻️ This comment has been updated with latest results.

@quiet-node quiet-node modified the milestones: 0.52.0, 0.53.0 Jul 15, 2024
…nce-tests

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

# Conflicts:
#	package.json
#	packages/relay/src/lib/clients/sdkClient.ts
#	packages/server/tests/acceptance/rateLimiter.spec.ts
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
@victor-yanev victor-yanev self-assigned this Jul 23, 2024
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
…cal`

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
…the remaining hbar limiter balanace

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Copy link

sonarcloud bot commented Jul 24, 2024

@victor-yanev victor-yanev marked this pull request as ready for review July 24, 2024 14:00
@victor-yanev victor-yanev requested review from a team as code owners July 24, 2024 14:00
Copy link
Collaborator

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. Nice work.

@victor-yanev victor-yanev merged commit 33aecca into main Jul 25, 2024
34 checks passed
@victor-yanev victor-yanev deleted the 2696-enhance-hbar-limiter-acceptance-tests branch July 25, 2024 08:44
ebadiere pushed a commit that referenced this pull request Aug 1, 2024
* test: add additional hbar limiter tests

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* chore: remove duplicate variable

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* chore: update tests after merge from main

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: move hbar limiter tests to separate job

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: small fix

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: small fix

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: do not restart relay and create accounts if `!global.relayIsLocal`

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: fix tests

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: fix tests

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* chore: restore rateLimiter tests to be the same as before

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* test: improved assertions to compare the cost of the transaction and the remaining hbar limiter balanace

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* test: adjust expected costs

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* test: add `needs: hbarlimiter` to `publish_results`

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* test: change delta to 0.1% tolerance

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

* test: extract common logic for checking remaining hbar limit

Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>

---------

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Co-authored-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: ebadiere <ebadiere@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expand Hbar Limiter coverage Enhance Hbar Limiter Acceptance tests
5 participants