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: fix mdw and reduce global timeout #1987

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
require: 'tooling/babel-register.js',
recursive: true,
extension: '.js,.ts',
timeout: process.env.NETWORK ? '500s' : '40s',
timeout: process.env.NETWORK ? '500s' : '8s',
ignore: 'test/environment/**',
exit: true // TODO: fix in state channel tests
}
3 changes: 3 additions & 0 deletions test/integration/Middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('Middleware API', () => {
payload: {
block_hash: 'mh_LAo6Cg6d8LGDpxJ3se2aGJZbCubDZyC6GonHK58MKiW4a4LWb',
block_height: 779178,
encoded_tx: 'tx_+QEKCwHAuQEE+QEBUQKhAR1BkBtnVYcqjIhl7aOh9hEy9W96OFTeeQreTa3ExE/auG8rEWzyVws7Ap8AoLb4BE1sdD+LZw3SM+libDajr+a976yRMKi9b7k5whrinwEBAFGw3Ke65y52/KhwL5lYHOlRuOIZZy2V190M5H1ywIgN5fAylDfLImUL3WDwC4UAHa6EcyMc3Pl8apaHFuO79AMDhkduhMz4AILDUIQ7msoAuFr4WAsBwLhT+FEMAaEBHUGQG2dVhyqMiGXto6H2ETL1b3o4VN55Ct5NrcTET9qhAUCcLjbyYA3yE1vkfr0zC0M4oNrQ3lNoPHDD6EzUnVzAcIYPJvVhyAAAAIAv4MYN',
hash: 'th_YHj5aB6JzHciY5f6jqgtso8u2iY9p6MT9RV96FwXQNS1MpSML',
micro_index: 18,
micro_time: 1684995426848,
Expand Down Expand Up @@ -79,6 +80,7 @@ describe('Middleware API', () => {
payload: {
block_hash: 'mh_2R1PVwTNP3Jha7oRby9Me3SRBP4R9he6RMH6eCCJGyVBHAzy5f',
block_height: 779178,
encoded_tx: 'tx_+QayCwH4QrhAwG9pipSjLr6vd/WIyokLy1Pj3aybjCnlZeJwMacD4T6rOgl6qQzbzWsR6w5caPmnZEQ9hXUOtTVH/T3L3MHpA7kGafkGZlABoQEdQZAbZ1WHKoyIZe2jofYRMvVvejhU3nkK3k2txMRP2gG5Bd75BdtGA6AhYBMZ2y1+tz8gF0bhQfiQAXA++XyzbIlh5YVUJMgWO8C5Ba25BD/+PR6JaAA3ADcERwBnRwCHAzcANwEHNwEHhwI3ADcBNwIHBwcMAoIMAoQMAoYMAognDAgA/kTWRB8ANwFHADcAVQAjBAAHDAT7A61NYXN0ZXIgbm90IGFsbG93ZWQgdG8gYmUgdGhlIGFjY291bnQgaXRzZWxmGg6ELwAaDoavggABARsrb4cHGv1JjP/Ab4Xo1KUPwBoGggAaDogCAQM//kZnE6AANwKXQAeXQAwBAgwBAAIDEd95h1wCAxGNc7oMAgMRq4gy0R0AAP5XMYoXADcBhwI3ADcBNwIHBzcAVQAgIIIHDAT7Az1Pbmx5IGZvciBtYXN0ZXIaBoYAAQM//mzyVwsANwMHRwCXbwAXIiQAiAcMBPsDNU5vbmNlIHRvbyBsb3chJACIBwwI+wM5Tm9uY2UgdG9vIGhpZ2gCAxGvdzaYBwwO+wNhRmVlIG9yIGdhc3ByaWNlIHRvbyBoaWdoDAECAgMRzkOMiQcMFPsDTU5vdCBhbGxvd2VkIHRvIHNpZ24CAxHT9vk+Bwwa+wM9QW1vdW50IHRvbyBoaWdoFDaIAAJ3AigIPiggHAwBBAwBAgwBAEY4KAACAxFGZxOgdAAA+wNNTm90IGluIEF1dGggY29udGV4dP5zsBfaADcBRwCHAjcANwGHAzcANwEHNwEHGgoAhC8YhAAHDAQBA6+CAAEAPysYAABE/CMAAgICAP6Nc7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b2sR2ajBKCVnZXRfbm9uY2UR33mHXEl0b19zaWduX3VucHJlZml4ZWQR5syMIzFnZXRfdHJ1c3RlZXMR8qxXhTlyZW1vdmVfdHJ1c3RlZRH5EvIfLWFkZF90cnVzdGVlgi8AhTcuMS4wAKBs8lcLChWZtwgpHlCqPa8T0MfySEvDN92tJBOjf9SgCYMHAAOGYg/MzLgAAIICVYQ7msoAqisRRNZEHxufAKC2+ARNbHQ/i2cN0jPpYmw2o6/mve+skTCovW+5OcIa4gGo5Xk=',
hash: 'th_AScnu6AAGHvfewMELKvmc6KH9jaMfzopGpcFFo1HAoS7ne1fD',
micro_index: 11,
micro_time: 1684995366595,
Expand Down Expand Up @@ -118,6 +120,7 @@ describe('Middleware API', () => {
payload: {
block_hash: 'mh_25snWYwTkU1xjPCcH592XVNzL894qSpF4yqnt8tABKGEVm6nSz',
block_height: 779178,
encoded_tx: 'tx_+K4LAfhCuEBjZgd36W2H8rB5KZzut7wvRnAsjJSD+CEg8Dbm8ivFXmDzKFauG8QJpnm9kmVnNl0xOI7xVsm0brXYTMNuAmUDuGb4ZAwBoQHhMrjx3begTmO3+pZHmlS7xSWlMafxvAzkkhIZAwZ/sKEBHUGQG2dVhyqMiGXto6H2ETL1b3o4VN55Ct5NrcTET9qIRWORgkT0AACGD39vJaAAAIKQmIlGYXVjZXQgVHiaKLKm',
hash: 'th_242zV1qXwag6iBH3Pd8zn3DQC37h4uP38CoFjkaTgT19AVKMHo',
micro_index: 7,
micro_time: 1684995336526,
Expand Down
8 changes: 4 additions & 4 deletions test/integration/MiddlewareSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('MiddlewareSubscriber', () => {
}),
]);
expect(transaction).to.be.eql(await fetchNodeRaw(`transactions/${hash}`));
}).timeout(80_000);
});

// TODO: enable after fixing https://github.com/aeternity/ae_mdw/issues/1337
it.skip('subscribes for account', async () => {
Expand All @@ -138,7 +138,7 @@ describe('MiddlewareSubscriber', () => {
});
});
expect(transaction).to.be.eql(await fetchNodeRaw(`transactions/${hash}`));
}).timeout(80_000);
});

// TODO: enable after solving https://github.com/aeternity/ae_mdw/issues/1336
it.skip('subscribes for micro block', async () => {
Expand All @@ -153,7 +153,7 @@ describe('MiddlewareSubscriber', () => {
}),
]);
expect(microBlock).to.be.eql(await fetchNodeRaw(`micro-blocks/hash/${blockHash}/header`));
}).timeout(80_000);
});

// TODO: enable after solving https://github.com/aeternity/ae_mdw/issues/1336
it.skip('subscribes simultaneously for micro block', async () => {
Expand All @@ -177,5 +177,5 @@ describe('MiddlewareSubscriber', () => {
]);
expect(transaction).to.be.eql(await fetchNodeRaw(`transactions/${hash}`));
expect(microBlock).to.be.eql(await fetchNodeRaw(`micro-blocks/hash/${blockHash}/header`));
}).timeout(80_000);
});
});
4 changes: 2 additions & 2 deletions test/integration/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ describe('CompilerHttp', () => {
});

it('throws exception if used invalid compiler url', async () => {
const c = new CompilerHttpNode('https://compiler.aepps.comas');
const c = new CompilerHttpNode('https://compilaer.aepps.com');
await expect(c.compileBySourceCode('test'))
.to.be.rejectedWith('getaddrinfo ENOTFOUND compiler.aepps.comas');
.to.be.rejectedWith('getaddrinfo ENOTFOUND compilaer.aepps.com');
});

describe('getFileSystem', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/integration/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ const getConnections = (): { walletWindow: ImplPostMessage; aeppWindow: ImplPost
return { walletWindow, aeppWindow };
};

describe('Aepp<->Wallet', function aeppWallet() {
this.timeout(8000);
describe('Aepp<->Wallet', () => {
const connections = getConnections();
const connectionFromWalletToAepp = new BrowserWindowMessageConnection({
self: connections.walletWindow,
Expand Down