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

Fix/e2e test improvements #2195

Merged
merged 8 commits into from
Oct 24, 2024
Merged

Fix/e2e test improvements #2195

merged 8 commits into from
Oct 24, 2024

Conversation

wilwade
Copy link
Collaborator

@wilwade wilwade commented Oct 23, 2024

Goal

The goal of this PR is to add a final set of e2e test improvements to allow e2e tests to run against testnet again post async-backing

Closes #2154

Discussion

  • Added a way to wait for finalization
  • Added errors instead of waiting forever for blocks
  • Reduced timeouts thanks to 6s blocktimes on testnet
  • Split up more tests for better parallelization

Testing

@@ -0,0 +1,226 @@
import '@frequency-chain/api-augment';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved from transactions.test.ts. No changes

@@ -1,10 +1,8 @@
import '@frequency-chain/api-augment';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only moved some tests to capacityFail.test.ts. No other changes.

@@ -11,7 +11,7 @@ import { hasRelayChain } from '../scaffolding/env';
import { getFundingSource } from '../scaffolding/funding';

const fundingSource = getFundingSource('handles');
const expirationOffset = hasRelayChain() ? 10 : 100;
const expirationOffset = hasRelayChain() ? 4 : 100;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With testnet at 6s block times, this can be reduced

@@ -68,7 +68,7 @@ describe('Passkey Pallet Tests', function () {
const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false);
const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload);
assert.doesNotReject(passkeyProxy.fundAndSendUnsigned(fundingSource));
await ExtrinsicHelper.runToBlock(await getNextEpochBlock());
await ExtrinsicHelper.waitForFinalization();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bugfix. This should have been this all along.

while (currentBlock < blockNumber) {
if (start + 48_000 < Date.now()) {
throw new Error(
`Waiting for Finalized Block took longer than 48s. Waiting for "${blockNumber.toString()}", Current: "${currentBlock.toString()}"`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a life saver. Some of these were taking forever and it was really hard to track down. Now they are capped.

@wilwade wilwade marked this pull request as ready for review October 23, 2024 23:23
@wilwade wilwade requested review from a team, shannonwells, mattheworris, enddynayn, aramikm, claireolmstead and JoeCap08055 and removed request for a team October 23, 2024 23:23
@wilwade wilwade enabled auto-merge (squash) October 23, 2024 23:23
@wilwade wilwade disabled auto-merge October 24, 2024 16:00
@wilwade wilwade merged commit 9ba9bdd into main Oct 24, 2024
27 of 28 checks passed
@wilwade wilwade deleted the fix/e2e-test-improvements branch October 24, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testnet e2e Tests Failing
2 participants