-
Notifications
You must be signed in to change notification settings - Fork 63
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: stabilize acceptance tests and update local-node #2255
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2255 +/- ##
=======================================
Coverage 75.15% 75.15%
=======================================
Files 13 13
Lines 644 644
Branches 118 118
=======================================
Hits 484 484
Misses 115 115
Partials 45 45 ☔ View full report in Codecov by Sentry. |
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.
LGTM
a040e9f
to
6411c43
Compare
f57c043
to
7831882
Compare
aa65ea2
to
e2783fa
Compare
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.
Good effort on stabilization.
Left some comments on 1st pass
const contractExecuteResponse = await this.hapiService | ||
.getSDKClient() | ||
.submitEthereumTransaction(transactionBuffer, EthImpl.ethSendRawTransaction, requestIdPrefix); | ||
const contractExecuteResponse = await this.sendRawTransactionWithRetry( |
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.
Q: Why are we retrying for sendRawTransaction vs leaving it on user client logic?
The challenge is here is there's balance implication to both the sender and the host.
@@ -101,7 +101,7 @@ export default class HAPIService { | |||
const currentDateNow = Date.now(); | |||
this.initialTransactionCount = parseInt(process.env.HAPI_CLIENT_TRANSACTION_RESET!) || 0; | |||
this.initialResetDuration = parseInt(process.env.HAPI_CLIENT_DURATION_RESET!) || 0; | |||
this.initialErrorCodes = JSON.parse(process.env.HAPI_CLIENT_ERROR_RESET || '[50]'); | |||
this.initialErrorCodes = JSON.parse(process.env.HAPI_CLIENT_ERROR_RESET || '[21, 50]'); |
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.
Q:50 is INVALID_TRANSACTION_BODY and 21 is UNKNOWN
We should document these somewhere. Likely in configs README
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.
Added to configuration.md
|
||
this.beforeAll(async () => { | ||
requestId = Utils.generateRequestId(); | ||
const initialAccount: AliasAccount = global.accounts[0]; | ||
const initialAmount: string = '5000000000'; //50 Hbar |
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 make this configureable
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.
Done.
const contractDeployer = await servicesNode.createAliasAccount(50, relay.provider, requestId); | ||
BaseHTSContractAddress = await deployBaseHTSContract(contractDeployer.wallet); | ||
const initialAccount: AliasAccount = global.accounts[0]; | ||
const initialAmount: string = '5000000000'; //50 Hbar |
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.
make configureable
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.
Done.
|
||
global.accounts = new Array<AliasAccount>(initialAccount); | ||
// wait 3 seconds to propagate to mirror node all needed changes. | ||
await new Promise((r) => setTimeout(r, 3000)); |
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.
Q: Why wait instead of poll.
Waiting can be problematic and hides failure reasons
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.
Yep, you're right. Changed.
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.
Absolute wonderful work! Thanks a lot! I left comments and questions around!
packages/server/tests/acceptance/htsPrecompile/tokenManagement.spec.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: update local node Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: set verbose to trace Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: bump service tag Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: add extra debug steps Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> chore: fix debug test Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> chore: fix debugging Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> chore: fix debugging Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> chore:test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: testing Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> chore: revert reset counts Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> fix: vlaue fiddle Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> add env logging Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> bump timeout Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> switch to full node Signed-off-by: Iliya Savov <isavov@users.noreply.github.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> revert unnecessery changes Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 1 Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 1 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix tests Signed-off-by: georgi-l95 <glazarov95@gmail.com> remove only Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimize rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimization Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimize Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimizaitons Signed-off-by: georgi-l95 <glazarov95@gmail.com> more optimizations and code smells Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimization Signed-off-by: georgi-l95 <glazarov95@gmail.com> adds JSDocs Signed-off-by: georgi-l95 <glazarov95@gmail.com> last optimizations to rpc_batch1 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rateLimiter.spec.ts Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimize htsPrecompile_v1.spec.ts Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimize precompileCalls Signed-off-by: georgi-l95 <glazarov95@gmail.com> revert Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix precompileCall Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimize rpc_batch2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimize rpc_batch2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc_batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix precompileCalls Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> disable batch Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc_batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc_batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc_batch 2 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rpc batch 2 and 3 Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix rate limiter Signed-off-by: georgi-l95 <glazarov95@gmail.com> revert changes to retry script Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix tokenCreate Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: update local node Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: update sdk Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> rework ws acceptance tests Signed-off-by: georgi-l95 <glazarov95@gmail.com> add logger Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> adjust websocket values Signed-off-by: georgi-l95 <glazarov95@gmail.com> address comments Signed-off-by: georgi-l95 <glazarov95@gmail.com> optimization Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix websocket tests Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix websocket tests Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix precompilecalls Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com> chore: add missing type Signed-off-by: georgi-l95 <glazarov95@gmail.com> apply more clear logic to condition Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
4196163
to
7743925
Compare
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Quality Gate failedFailed conditions |
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.
LGTM. Great work!
Description:
This PR aims to update local node version to latest and utilize the modulirezed codebase version of the network node, as well as refactor most of the acceptance tests, because now network node is more heavy and this makes the tests flaky. SDKs are timing out, probably due to not enough resources.
index.spec.ts
:index.spec.ts
:before
of most of the tests to add optimizations, rely less on SDKs and more on the relay itself.eth_sendRawTransaction
to retry on certain errors, like Timeout or connection dropped. Retyring triggers the flow of creating new instance of the SDK Client, which should mitigate the issues we face with the new local-node versions and more specifically when Client is configured to point against only one node.Positives:
Related issue(s):
Fixes #2309
Fixes #2341
Notes for reviewer:
This will not fix the issues with the SDK itself and how we handle timeout. This will be done in the next PR to avoid many changes at once. Main aim here is to update to the latest modularization code base and make use of the tests.
Checklist