Skip to content

Commit

Permalink
fix tests (#174)
Browse files Browse the repository at this point in the history
* fix tests

* more retry on CI
  • Loading branch information
xlc authored Mar 22, 2024
1 parent cc035a3 commit 7b67743
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 72 deletions.
8 changes: 4 additions & 4 deletions tests/acala/__snapshots__/stable-asset.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`acala stable asset > mint overflow > events 1`] = `
"paysFee": "Yes",
"weight": {
"proofSize": "(rounded 17000)",
"refTime": "(rounded 1400000000)",
"refTime": "(rounded 1300000000)",
},
},
},
Expand Down Expand Up @@ -62,7 +62,7 @@ exports[`acala stable asset > swap overflow > events 1`] = `
"paysFee": "Yes",
"weight": {
"proofSize": "(rounded 11000)",
"refTime": "(rounded 3300000000)",
"refTime": "(rounded 3000000000)",
},
},
},
Expand Down Expand Up @@ -165,7 +165,7 @@ exports[`karura stable asset > mint overflow > events 1`] = `
"paysFee": "Yes",
"weight": {
"proofSize": "(rounded 17000)",
"refTime": "(rounded 1400000000)",
"refTime": "(rounded 1300000000)",
},
},
},
Expand Down Expand Up @@ -215,7 +215,7 @@ exports[`karura stable asset > swap overflow > events 1`] = `
"paysFee": "Yes",
"weight": {
"proofSize": "(rounded 11000)",
"refTime": "(rounded 3300000000)",
"refTime": "(rounded 3000000000)",
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions tests/bridge-sdk/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export const buildTests = (tests: ReadonlyArray<TestTtype>) => {

await fromchain.chain.newBlock()
await tochain.chain.newBlock()
if (tochain.api.query.messageQueue) {
// messageQueue always delay XCM for one block for no good reason https://github.com/paritytech/polkadot-sdk/issues/3709
await tochain.chain.newBlock()
}

await sleep(100)
const chainBalanceNow = await chainBalance(sdk, fromData, address)
Expand Down
13 changes: 8 additions & 5 deletions tests/xcm-transfer/__snapshots__/kusama-para.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,18 @@ exports[`'statemine' -> 'karura' xcm transfer 'USDT' > xcmPallet transfer > to c
[
{
"data": {
"messageHash": "(hash)",
"messageId": "(hash)",
"weight": {
"id": "(hash)",
"origin": {
"Sibling": 1000,
},
"success": true,
"weightUsed": {
"proofSize": 0,
"refTime": 1000000000,
},
},
"method": "Success",
"section": "xcmpQueue",
"method": "Processed",
"section": "messageQueue",
},
]
`;
Expand Down
29 changes: 5 additions & 24 deletions tests/xcm-transfer/__snapshots__/kusama-relay.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -355,35 +355,16 @@ exports[`'kusama' -> 'karura' xcm transfer 'KSM' > xcmPallet transfer > to chain
[
{
"data": {
"count": 1,
},
"method": "DownwardMessagesReceived",
"section": "parachainSystem",
},
{
"data": {
"messageHash": "(hash)",
"messageId": "(hash)",
"outcome": {
"Complete": {
"proofSize": 0,
"refTime": 1000000000,
},
},
},
"method": "ExecutedDownward",
"section": "dmpQueue",
},
{
"data": {
"dmqHead": "(hash)",
"id": "(hash)",
"origin": "Parent",
"success": true,
"weightUsed": {
"proofSize": 0,
"refTime": 1000000000,
},
},
"method": "DownwardMessagesProcessed",
"section": "parachainSystem",
"method": "Processed",
"section": "messageQueue",
},
]
`;
Expand Down
30 changes: 16 additions & 14 deletions tests/xcm-transfer/__snapshots__/polkadot-para.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,16 @@ exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > to chain
[
{
"data": {
"messageHash": "(hash)",
"messageId": "(hash)",
"outcome": {
"Complete": {
"proofSize": 0,
"refTime": 1000000000,
},
"id": "(hash)",
"origin": "Parent",
"success": true,
"weightUsed": {
"proofSize": 0,
"refTime": 1000000000,
},
},
"method": "ExecutedDownward",
"section": "dmpQueue",
"method": "Processed",
"section": "messageQueue",
},
]
`;
Expand Down Expand Up @@ -731,15 +730,18 @@ exports[`'statemint' -> 'acala' xcm transfer 'WBTC' > xcmPallet transfer > to ch
[
{
"data": {
"messageHash": "(hash)",
"messageId": "(hash)",
"weight": {
"id": "(hash)",
"origin": {
"Sibling": 1000,
},
"success": true,
"weightUsed": {
"proofSize": 0,
"refTime": 1000000000,
},
},
"method": "Success",
"section": "xcmpQueue",
"method": "Processed",
"section": "messageQueue",
},
]
`;
Expand Down
30 changes: 6 additions & 24 deletions tests/xcm-transfer/__snapshots__/polkadot-relay.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -355,35 +355,16 @@ exports[`'polkadot' -> 'acala' xcm transfer 'DOT' > xcmPallet transfer > to chai
[
{
"data": {
"count": 1,
},
"method": "DownwardMessagesReceived",
"section": "parachainSystem",
},
{
"data": {
"messageHash": "(hash)",
"messageId": "(hash)",
"outcome": {
"Complete": {
"proofSize": 0,
"refTime": 1000000000,
},
},
},
"method": "ExecutedDownward",
"section": "dmpQueue",
},
{
"data": {
"dmqHead": "(hash)",
"id": "(hash)",
"origin": "Parent",
"success": true,
"weightUsed": {
"proofSize": 0,
"refTime": 1000000000,
},
},
"method": "DownwardMessagesProcessed",
"section": "parachainSystem",
"method": "Processed",
"section": "messageQueue",
},
]
`;
Expand Down Expand Up @@ -442,6 +423,7 @@ exports[`'polkadot' -> 'astar' xcm transfer 'DOT' > xcmPallet transfer > to chai
},
{
"data": {
"messageHash": "(hash)",
"messageId": "(hash)",
"outcome": {
"Complete": {
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
testTimeout: 240_000,
pool: 'forks',
passWithNoTests: true,
retry: 2,
retry: process.env.CI ? 3 : 2,
},
plugins: [swc.vite()],
})

0 comments on commit 7b67743

Please sign in to comment.