Skip to content

Commit

Permalink
fix: override spending limit env vars in acceptancetest:hbarlimiter s…
Browse files Browse the repository at this point in the history
…cript, with lower HBAR limits, to improve test performance

Override spending limit environment variables in the `acceptancetest:hbarlimiter` script to set lower HBAR limits at boot time. The HbarLimiter test suite includes several tests that exhaust the total HBAR limit for multiple plans, and using high spending limits can generate unnecessary traffic on the local node and extend the test duration. Overriding with lower limit values improves performance and reduces test execution time.

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
  • Loading branch information
quiet-node committed Oct 24, 2024
1 parent 9d4b4e1 commit 76a35c7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"acceptancetest:api_batch3": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@api-batch-3' --exit",
"acceptancetest:erc20": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@erc20' --exit",
"acceptancetest:ratelimiter": "nyc ts-mocha packages/ws-server/tests/acceptance/index.spec.ts -g '@web-socket-ratelimiter' --exit && ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@ratelimiter' --exit",
"acceptancetest:hbarlimiter": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@hbarlimiter' --exit",
"acceptancetest:hbarlimiter": "HBAR_RATE_LIMIT_TINYBAR=5000000000 HBAR_RATE_LIMIT_BASIC=1000000000 HBAR_RATE_LIMIT_EXTENDED=1500000000 HBAR_RATE_LIMIT_PRIVILEGED=2000000000 nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@hbarlimiter' --exit",
"acceptancetest:tokencreate": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@tokencreate' --exit",
"acceptancetest:tokenmanagement": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@tokenmanagement' --exit",
"acceptancetest:htsprecompilev1": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@htsprecompilev1' --exit",
Expand Down
6 changes: 2 additions & 4 deletions packages/server/tests/localAcceptance.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ LIMIT_DURATION=90000
SERVER_REQUEST_TIMEOUT_MS=60000
MEMWATCH_ENABLED=true
WRITE_SNAPSHOT_ON_MEMORY_LEAK=false
HBAR_RATE_LIMIT_TINYBAR=15000000000# 150 HBARs
HBAR_RATE_LIMIT_DURATION=180000# 180 seconds
HBAR_RATE_LIMIT_TINYBAR=5000000000# 50 HBARs
HBAR_RATE_LIMIT_DURATION=80000# 80 seconds
HBAR_RATE_LIMIT_BASIC=4000000000# 40 HBARs
HBAR_RATE_LIMIT_EXTENDED=4500000000# 45 HBARs
HBAR_RATE_LIMIT_PRIVILEGED=5000000000# 50 HBARs
HBAR_SPENDING_PLANS_CONFIG_FILE=./packages/server/tests/testSpendingPlansConfig.json
6 changes: 2 additions & 4 deletions packages/server/tests/mainnetAcceptance.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ MIRROR_NODE_URL_WEB3=https://mainnet.mirrornode.hedera.com
E2E_RELAY_HOST=https://mainnet.hashio.io/api
WS_RELAY_URL=wss://mainnet.hashio.io/ws
TEST_INITIAL_ACCOUNT_STARTING_BALANCE=500
HBAR_RATE_LIMIT_TINYBAR=15000000000# 150 HBARs
HBAR_RATE_LIMIT_DURATION=180000# 180 seconds
HBAR_RATE_LIMIT_TINYBAR=5000000000# 50 HBARs
HBAR_RATE_LIMIT_DURATION=80000# 80 seconds
HBAR_RATE_LIMIT_BASIC=4000000000# 40 HBARs
HBAR_RATE_LIMIT_EXTENDED=4500000000# 45 HBARs
HBAR_RATE_LIMIT_PRIVILEGED=5000000000# 50 HBARs
7 changes: 3 additions & 4 deletions packages/server/tests/previewnetAcceptance.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ SERVER_REQUEST_TIMEOUT_MS=60000
MEMWATCH_ENABLED=false
WRITE_SNAPSHOT_ON_MEMORY_LEAK=false
TEST_INITIAL_ACCOUNT_STARTING_BALANCE=500
HBAR_RATE_LIMIT_TINYBAR=15000000000# 150 HBARs
HBAR_RATE_LIMIT_DURATION=180000# 180 seconds
HBAR_RATE_LIMIT_TINYBAR=5000000000# 50 HBARs
HBAR_RATE_LIMIT_DURATION=80000# 80 seconds
HBAR_RATE_LIMIT_BASIC=4000000000# 40 HBARs
HBAR_RATE_LIMIT_EXTENDED=4500000000# 45 HBARs
HBAR_RATE_LIMIT_PRIVILEGED=5000000000# 50 HBARs

7 changes: 3 additions & 4 deletions packages/server/tests/testnetAcceptance.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ SERVER_REQUEST_TIMEOUT_MS=60000
MEMWATCH_ENABLED=false
WRITE_SNAPSHOT_ON_MEMORY_LEAK=false
TEST_INITIAL_ACCOUNT_STARTING_BALANCE=500
HBAR_RATE_LIMIT_TINYBAR=15000000000# 150 HBARs
HBAR_RATE_LIMIT_DURATION=180000# 180 seconds
HBAR_RATE_LIMIT_TINYBAR=5000000000# 50 HBARs
HBAR_RATE_LIMIT_DURATION=80000# 80 seconds
HBAR_RATE_LIMIT_BASIC=4000000000# 40 HBARs
HBAR_RATE_LIMIT_EXTENDED=4500000000# 45 HBARs
HBAR_RATE_LIMIT_PRIVILEGED=5000000000# 50 HBARs

0 comments on commit 76a35c7

Please sign in to comment.