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: enhanced hbarlimiter.spec.ts test suite #3199

Open
quiet-node opened this issue Oct 31, 2024 · 0 comments
Open

test: enhanced hbarlimiter.spec.ts test suite #3199

quiet-node opened this issue Oct 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@quiet-node
Copy link
Member

quiet-node commented Oct 31, 2024

Problem

  • First issue: Tests in the HBAR Limiter acceptance suite share and rely on the total HBAR budget controlled by the HbarLimitService class, with all expense additions occurring asynchronously in the background to avoid unnecessary wait time. As a result, the HBAR Limiter acceptance test requires a wait period after each test to allow the Relay sufficient time to properly update the burnt HBAR. This effectively adds wait_time * number_of_tests (ms) to the execution runtime, slowing down the entire process.

  • Second issue: Some tests in the HBAR Limiter acceptance suite rely on a tolerance, defined by TEST_TRANSACTION_RECORD_COST_TOLERANCE, to calculate the difference between total transaction costs with and without record query fees. This is because the test makes query calls to the consensus network, which adds query fees to the total HBAR limit. However, there is an option to make query calls to the mirror node by disabling the GET_RECORD_DEFAULT_TO_CONSENSUS_NODE flag, which could potentially eliminate the need for this tolerance.

Solution

  • First issue: Come up with a better polling solution to get the correct amount of the remaining HBARs
  • Second issue: Turn off the GET_RECORD_DEFAULT_TO_CONSENSUS_NODE and align the tests where necessary

Alternatives

No response

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
Status: Backlog
Development

No branches or pull requests

1 participant