-
Notifications
You must be signed in to change notification settings - Fork 33
Parallel e2e tests: Only start one instance of Parity, Bitcoind and one lnd per actor #2289
Conversation
Are you sure the changelog does not need updating? |
b1c7871
to
2087d7c
Compare
854508c
to
d9f2f3b
Compare
Status from my machine: Details (click here)
After killing parity and bitcoind the first run Details (click here)
Second time Details
Killed again bitcoind and parity. Details
Conclusion, as you mention: nodes do not shutdown after the tests, but once killed, the test run :) |
57ef8c0
to
f8fea60
Compare
@bonomat I just pushed some changes. The nodes should now be killed properly, even after a successful test run and before we start up (if there are some left over nodes). Can't get it to work for failing tests though. |
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.
It LGTM. I think I've reviewed some of this before :O
} | ||
|
||
private static extractLedgersToBeStarted( | ||
docblockPragmas: Record<string, string | string[]> |
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.
❓ What is a docblock pragma?
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.
The @foobar
stuff in doc comments above the tests :)
Yes there was a PR at some point but I had to follow a different approach in the end. |
Not sure what to do with this PR at the moment. I ran
I always checked for remaining Note that I noticed that around 20 instances of After cleaning the Findings:
Conclusion: I feel our tests are generally a bit brittle. The bitcoin/ethereum failures seems to be related to time again somehow. I would need to further investigate where the problems actually are. (it's a bit weird, because it seems it just does not start the swap - the logs just don't print any activity after start of cnd but also no error.) I'm quite sure this is not (just) related to this PR. Not sure if this is already approval ready. Thoughts, @thomaseizinger ? |
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.
I ran it a few times again:
here are the stats:
run 1: lnd_sanity.ts
failed / parity&bitcoind: running
$ jest --forceExit
FAIL tests/lnd_sanity.ts
● Test suite failed to run
OpenStatusUpdate is malformed: {"chanPending":{"txid":{"type":"Buffer","data":[110,83,150,108,9,45,102,135,153,223,176,167,82,14,203,250,234,10,210,13,104,178,123,77,190,163,17,69,62,116,27,50]}},"pendingChanId":{"type":"Buffer","data":[182,229,8,149,143,114,223,192,62,87,246,246,90,103,85,61,74,125,183,214,235,193,34,124,29,222,24,12,73,204,8,66]}}
at outpointFromChannelStatusUpdate (node_modules/comit-sdk/src/wallet/lightning.ts:210:9)
at LightningWallet.<anonymous> (node_modules/comit-sdk/src/wallet/lightning.ts:110:12)
at fulfilled (node_modules/comit-sdk/dist/src/wallet/lightning.js:5:58)
run 2: passed / parity & bitcoind: killed
run 3: passed / parity & bitcoind: killed
run 4: failed / parity & bitcoind: running:
FAIL tests/ethereum_bitcoin.ts (238.038s)
● E2E: Ethereum/ether - Bitcoin/bitcoin › rfc003-eth-btc-alice-redeems-with-high-fee
timed out after 60000ms
51 | const id = setTimeout(() => {
52 | clearTimeout(id);
> 53 | reject(new Error(`timed out after ${ms}ms`));
| ^
54 | }, ms);
55 | });
56 |
at Timeout.<anonymous> (src/utils.ts:53:20)
At the moment I'm running dev
4 times to see what's the behavior there.
I can't say for sure but I would assume that it's parity that got suck.
Note: not approving or rejecting this PR. Let's find a solution first.
@@ -1,67 +1,11 @@ | |||
/** |
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.
what was the reason for moving it out of the e2e
folder? I liked the folder structure :)
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.
It just added noise IMO and our new test_environment does not longer care about dry vs e2e tests. I just runs tests and starts things if the tests require that.
I would expect that the structure of these tests gets a lot clearer with #2193.
f8fea60
to
f3a477f
Compare
@thomaseizinger : I took over and rebased against origin/dev. |
I ran this branch 5 times in a row, everytime with success. There is a known limitation: in a failure case the nodes do not terminate. Nevertheless I opt for merging this if the happy case works for everyone and create a high priority follow up ticket to tackle the error case. @thomaseizinger , @da-kami , @luckysori , @tcharding , @rishflab , @D4nte , can you run the e2e tests from this branch please and report the results? you can use this command and just let it run it 5 times in a row (note, the log files will be overwritten on every run): for i in 1 2 3 4 5
do
echo "Test run $i"
yarn test --verbose
done
Test resultsfor i in 1 2 3 4 5
do
echo "Test run $i"
yarn test --verbose > log_$i.log
done
Test run 1
Finished dev [unoptimized + debuginfo] target(s) in 0.37s
Found pid file lnd-alice/lnd.pid, sending SIGINT to process with PID 74653
Found pid file lnd-bob/lnd.pid, sending SIGINT to process with PID 74654
PASS tests/lnd_sanity.ts (67.84s)
E2E: Sanity - LND Alice pays Bob
✓ sanity-lnd-alice-pays-bob (10081ms)
✓ sanity-lnd-alice-pays-bob-using-hold-invoice (10424ms)
(node:74836) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/sanity.ts (14.953s)
Sanity
✓ invalid-swap-yields-404 (1613ms)
✓ empty-swap-list-after-startup (1531ms)
✓ bad-request-for-invalid-swap-combination (1565ms)
✓ returns-invalid-body-for-bad-json (1580ms)
✓ alice-has-empty-peer-list (1552ms)
✓ returns-listen-addresses-on-root-document (1528ms)
✓ can-fetch-root-document-as-siren (1536ms)
✓ returns-listen-addresses-on-root-document-as-siren (1558ms)
✓ returns-links-to-create-swap-endpoints-on-root-document-as-siren (1542ms)
(node:74836) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/rfc003_schema.ts (10.411s)
Rfc003 schema tests
✓ get-all-swaps-is-valid-siren (1721ms)
✓ get-single-swap-is-valid-siren (1690ms)
✓ get-single-swap-contains-link-to-rfc (1630ms)
Rfc003 schema swap reject tests
✓ alice-can-make-default-swap-request (1611ms)
✓ bob-can-decline-swap (2824ms)
PASS tests/peers_using_ip.ts (7.736s)
Peers using IP tests
✓ alice-empty-peer-list (1559ms)
✓ alice-send-request-wrong-peer-id (2679ms)
✓ alice-send-swap-request-to-charlie (2628ms)
PASS tests/lightning_routes.ts (7.056s)
Lightning routes tests
✓ lightning-routes-post-eth-lnbtc-return-400 (1567ms)
✓ lightning-routes-post-erc20-lnbtc-return-400 (1529ms)
✓ lightning-routes-post-lnbtc-eth-return-400 (1575ms)
✓ lightning-routes-post-lnbtc-erc20-return-400 (1536ms)
PASS tests/multiple_peers.ts
Multiple peers tests
✓ alice-sends-swap-request-to-bob-and-charlie (1664ms)
(node:74834) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:74835) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/ethereum_bitcoin.ts (204.645s)
E2E: Ethereum/ether - Bitcoin/bitcoin
✓ rfc003-eth-btc-alice-redeems-bob-redeems (33379ms)
✓ rfc003-eth-btc-alpha-deploy-fails (30010ms)
✓ rfc003-eth-btc-bob-refunds-alice-refunds (29365ms)
✓ rfc003-eth-btc-alice-redeems-with-high-fee (22254ms)
E2E: Ethereum/erc20 - Bitcoin/bitcoin
✓ rfc003-eth-erc20_btc-alice-redeems-bob-redeems (28050ms)
✓ rfc003-eth-erc20_btc-bob-refunds-alice-refunds (31166ms)
PASS tests/bitcoin_ethereum.ts (429.383s)
E2E: Bitcoin/bitcoin - Ethereum/ether
✓ rfc003-btc-eth-alice-redeems-bob-redeems (29955ms)
✓ rfc003-btc-eth-bob-refunds-alice-refunds (30732ms)
✓ rfc003-btc-eth-alice-refunds-bob-refunds (28123ms)
✓ rfc003-btc-eth-cnd-can-be-restarted (15075ms)
✓ rfc003-btc-eth-resume-alice-down-bob-funds (25898ms)
✓ rfc003-btc-eth-resume-alice-down-bob-redeems (28781ms)
✓ rfc003-btc-eth-resume-bob-down-alice-funds (31333ms)
✓ rfc003-btc-eth-resume-bob-down-alice-redeems (21272ms)
✓ rfc003-btc-eth-alice-underfunds-bob-aborts (34234ms)
✓ rfc003-btc-eth-bob-underfunds-both-refund (30487ms)
✓ rfc003-btc-eth-alice-overfunds-bob-aborts (33971ms)
✓ rfc003-btc-eth-bob-overfunds-both-refund (29984ms)
E2E: Bitcoin/bitcoin - Ethereum/erc20
✓ rfc003-btc-eth-erc20-alice-redeems-bob-redeems (26442ms)
✓ rfc003-btc-eth-erc20-bob-refunds-alice-refunds (27653ms)
Test Suites: 8 passed, 8 total
Tests: 44 passed, 44 total
Snapshots: 0 total
Time: 432.915s, estimated 454s
Ran all test suites.
Found pid file bitcoind/bitcoind.pid, sending SIGINT to process with PID 74841
Found pid file lnd-alice/lnd.pid, sending SIGINT to process with PID 74845
Found pid file lnd-bob/lnd.pid, sending SIGINT to process with PID 74846
Found pid file parity/parity.pid, sending SIGINT to process with PID 74840
Found pid file parity/parity.pid, sending SIGINT to process with PID 74840
Error: kill ESRCH
at process.kill (internal/process/per_thread.js:196:13)
at Object.<anonymous> (/Users/bonomat/src/github/comit/comit-rs/api_tests/src/environment/kill_nodes.ts:33:25)
at Generator.next (<anonymous>)
at fulfilled (/Users/bonomat/src/github/comit/comit-rs/api_tests/src/environment/kill_nodes.ts:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 1.
Test run 2
Finished dev [unoptimized + debuginfo] target(s) in 0.96s
PASS tests/lnd_sanity.ts (56.676s)
E2E: Sanity - LND Alice pays Bob
✓ sanity-lnd-alice-pays-bob (9572ms)
✓ sanity-lnd-alice-pays-bob-using-hold-invoice (9983ms)
(node:75047) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/sanity.ts (14.777s)
Sanity
✓ invalid-swap-yields-404 (1549ms)
✓ empty-swap-list-after-startup (1530ms)
✓ bad-request-for-invalid-swap-combination (1533ms)
✓ returns-invalid-body-for-bad-json (1531ms)
✓ alice-has-empty-peer-list (1547ms)
✓ returns-listen-addresses-on-root-document (1555ms)
✓ can-fetch-root-document-as-siren (1536ms)
✓ returns-listen-addresses-on-root-document-as-siren (1545ms)
✓ returns-links-to-create-swap-endpoints-on-root-document-as-siren (1537ms)
(node:75047) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/rfc003_schema.ts (9.91s)
Rfc003 schema tests
✓ get-all-swaps-is-valid-siren (1563ms)
✓ get-single-swap-is-valid-siren (1609ms)
✓ get-single-swap-contains-link-to-rfc (1594ms)
Rfc003 schema swap reject tests
✓ alice-can-make-default-swap-request (1723ms)
✓ bob-can-decline-swap (2712ms)
PASS tests/peers_using_ip.ts (7.703s)
Peers using IP tests
✓ alice-empty-peer-list (1725ms)
✓ alice-send-request-wrong-peer-id (2613ms)
✓ alice-send-swap-request-to-charlie (2638ms)
PASS tests/lightning_routes.ts (7.432s)
Lightning routes tests
✓ lightning-routes-post-eth-lnbtc-return-400 (1603ms)
✓ lightning-routes-post-erc20-lnbtc-return-400 (1571ms)
✓ lightning-routes-post-lnbtc-eth-return-400 (1536ms)
✓ lightning-routes-post-lnbtc-erc20-return-400 (1535ms)
PASS tests/multiple_peers.ts
Multiple peers tests
✓ alice-sends-swap-request-to-bob-and-charlie (1945ms)
(node:75045) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:75046) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/ethereum_bitcoin.ts (193.106s)
E2E: Ethereum/ether - Bitcoin/bitcoin
✓ rfc003-eth-btc-alice-redeems-bob-redeems (24380ms)
✓ rfc003-eth-btc-alpha-deploy-fails (29231ms)
✓ rfc003-eth-btc-bob-refunds-alice-refunds (24903ms)
✓ rfc003-eth-btc-alice-redeems-with-high-fee (21077ms)
E2E: Ethereum/erc20 - Bitcoin/bitcoin
✓ rfc003-eth-erc20_btc-alice-redeems-bob-redeems (29080ms)
✓ rfc003-eth-erc20_btc-bob-refunds-alice-refunds (30280ms)
PASS tests/bitcoin_ethereum.ts (418.606s)
E2E: Bitcoin/bitcoin - Ethereum/ether
✓ rfc003-btc-eth-alice-redeems-bob-redeems (30038ms)
✓ rfc003-btc-eth-bob-refunds-alice-refunds (30539ms)
✓ rfc003-btc-eth-alice-refunds-bob-refunds (28832ms)
✓ rfc003-btc-eth-cnd-can-be-restarted (9482ms)
✓ rfc003-btc-eth-resume-alice-down-bob-funds (31254ms)
✓ rfc003-btc-eth-resume-alice-down-bob-redeems (23991ms)
✓ rfc003-btc-eth-resume-bob-down-alice-funds (30420ms)
✓ rfc003-btc-eth-resume-bob-down-alice-redeems (25809ms)
✓ rfc003-btc-eth-alice-underfunds-bob-aborts (33349ms)
✓ rfc003-btc-eth-bob-underfunds-both-refund (25423ms)
✓ rfc003-btc-eth-alice-overfunds-bob-aborts (33082ms)
✓ rfc003-btc-eth-bob-overfunds-both-refund (30637ms)
E2E: Bitcoin/bitcoin - Ethereum/erc20
✓ rfc003-btc-eth-erc20-alice-redeems-bob-redeems (26272ms)
✓ rfc003-btc-eth-erc20-bob-refunds-alice-refunds (33270ms)
Test Suites: 8 passed, 8 total
Tests: 44 passed, 44 total
Snapshots: 0 total
Time: 421.822s, estimated 430s
Ran all test suites.
Found pid file bitcoind/bitcoind.pid, sending SIGINT to process with PID 75051
Found pid file lnd-alice/lnd.pid, sending SIGINT to process with PID 75057
Found pid file lnd-bob/lnd.pid, sending SIGINT to process with PID 75058
Found pid file parity/parity.pid, sending SIGINT to process with PID 75052
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
Test run 3
Finished dev [unoptimized + debuginfo] target(s) in 0.89s
PASS tests/lnd_sanity.ts (57.084s)
E2E: Sanity - LND Alice pays Bob
✓ sanity-lnd-alice-pays-bob (5920ms)
✓ sanity-lnd-alice-pays-bob-using-hold-invoice (5181ms)
(node:75253) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/sanity.ts (14.609s)
Sanity
✓ invalid-swap-yields-404 (1549ms)
✓ empty-swap-list-after-startup (1558ms)
✓ bad-request-for-invalid-swap-combination (1568ms)
✓ returns-invalid-body-for-bad-json (1551ms)
✓ alice-has-empty-peer-list (1531ms)
✓ returns-listen-addresses-on-root-document (1548ms)
✓ can-fetch-root-document-as-siren (1539ms)
✓ returns-listen-addresses-on-root-document-as-siren (1536ms)
✓ returns-links-to-create-swap-endpoints-on-root-document-as-siren (1547ms)
(node:75252) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:75251) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:75253) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
FAIL tests/rfc003_schema.ts (130.993s)
Rfc003 schema tests
✓ get-all-swaps-is-valid-siren (121794ms)
✓ get-single-swap-is-valid-siren (2287ms)
✓ get-single-swap-contains-link-to-rfc (1573ms)
Rfc003 schema swap reject tests
✓ alice-can-make-default-swap-request (1860ms)
✓ bob-can-decline-swap (2668ms)
Test Suites: 8 passed, 8 total
Tests: 44 passed, 44 total
Snapshots: 0 total
Time: 441.794s
Ran all test suites.
Finished dev [unoptimized + debuginfo] target(s) in 2.13s
Found pid file bitcoind/bitcoind.pid, sending SIGINT to process with PID 75258
Found pid file lnd-alice/lnd.pid, sending SIGINT to process with PID 75266
Found pid file lnd-bob/lnd.pid, sending SIGINT to process with PID 75267
Found pid file parity/parity.pid, sending SIGINT to process with PID 75257
PASS tests/lnd_sanity.ts (49.137s)
E2E: Sanity - LND Alice pays Bob
✓ sanity-lnd-alice-pays-bob (4796ms)
✓ sanity-lnd-alice-pays-bob-using-hold-invoice (5245ms)
(node:75433) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/sanity.ts (19.619s)
Sanity
✓ invalid-swap-yields-404 (1541ms)
✓ empty-swap-list-after-startup (1536ms)
✓ bad-request-for-invalid-swap-combination (1551ms)
✓ returns-invalid-body-for-bad-json (1537ms)
✓ alice-has-empty-peer-list (6559ms)
✓ returns-listen-addresses-on-root-document (1551ms)
✓ can-fetch-root-document-as-siren (1534ms)
✓ returns-listen-addresses-on-root-document-as-siren (1540ms)
✓ returns-links-to-create-swap-endpoints-on-root-document-as-siren (1537ms)
(node:75433) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/rfc003_schema.ts (10.238s)
Rfc003 schema tests
✓ get-all-swaps-is-valid-siren (1548ms)
✓ get-single-swap-is-valid-siren (2128ms)
✓ get-single-swap-contains-link-to-rfc (1666ms)
Rfc003 schema swap reject tests
✓ alice-can-make-default-swap-request (1619ms)
✓ bob-can-decline-swap (2622ms)
PASS tests/peers_using_ip.ts (8.653s)
Peers using IP tests
✓ alice-empty-peer-list (1794ms)
✓ alice-send-request-wrong-peer-id (2658ms)
✓ alice-send-swap-request-to-charlie (2606ms)
PASS tests/lightning_routes.ts (7.121s)
Lightning routes tests
✓ lightning-routes-post-eth-lnbtc-return-400 (1562ms)
✓ lightning-routes-post-erc20-lnbtc-return-400 (1552ms)
✓ lightning-routes-post-lnbtc-eth-return-400 (1603ms)
✓ lightning-routes-post-lnbtc-erc20-return-400 (1553ms)
PASS tests/multiple_peers.ts
Multiple peers tests
✓ alice-sends-swap-request-to-bob-and-charlie (1674ms)
(node:75432) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:75431) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/ethereum_bitcoin.ts (178.656s)
E2E: Ethereum/ether - Bitcoin/bitcoin
✓ rfc003-eth-btc-alice-redeems-bob-redeems (27696ms)
✓ rfc003-eth-btc-alpha-deploy-fails (24733ms)
✓ rfc003-eth-btc-bob-refunds-alice-refunds (23157ms)
✓ rfc003-eth-btc-alice-redeems-with-high-fee (16482ms)
E2E: Ethereum/erc20 - Bitcoin/bitcoin
✓ rfc003-eth-erc20_btc-alice-redeems-bob-redeems (27324ms)
✓ rfc003-eth-erc20_btc-bob-refunds-alice-refunds (31699ms)
PASS tests/bitcoin_ethereum.ts (418.676s)
E2E: Bitcoin/bitcoin - Ethereum/ether
✓ rfc003-btc-eth-alice-redeems-bob-redeems (23591ms)
✓ rfc003-btc-eth-bob-refunds-alice-refunds (31494ms)
✓ rfc003-btc-eth-alice-refunds-bob-refunds (28010ms)
✓ rfc003-btc-eth-cnd-can-be-restarted (14263ms)
✓ rfc003-btc-eth-resume-alice-down-bob-funds (30560ms)
✓ rfc003-btc-eth-resume-alice-down-bob-redeems (24860ms)
✓ rfc003-btc-eth-resume-bob-down-alice-funds (31000ms)
✓ rfc003-btc-eth-resume-bob-down-alice-redeems (25277ms)
✓ rfc003-btc-eth-alice-underfunds-bob-aborts (28814ms)
✓ rfc003-btc-eth-bob-underfunds-both-refund (25157ms)
✓ rfc003-btc-eth-alice-overfunds-bob-aborts (33516ms)
✓ rfc003-btc-eth-bob-overfunds-both-refund (30895ms)
E2E: Bitcoin/bitcoin - Ethereum/erc20
✓ rfc003-btc-eth-erc20-alice-redeems-bob-redeems (30448ms)
✓ rfc003-btc-eth-erc20-bob-refunds-alice-refunds (27451ms)
Test Suites: 8 passed, 8 total
Tests: 44 passed, 44 total
Snapshots: 0 total
Time: 421.797s
Ran all test suites.
Found pid file bitcoind/bitcoind.pid, sending SIGINT to process with PID 75438
Found pid file lnd-alice/lnd.pid, sending SIGINT to process with PID 75443
Found pid file lnd-bob/lnd.pid, sending SIGINT to process with PID 75444
Found pid file parity/parity.pid, sending SIGINT to process with PID 75437
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
Test run 5
Finished dev [unoptimized + debuginfo] target(s) in 0.89s
PASS tests/lnd_sanity.ts (44.481s)
E2E: Sanity - LND Alice pays Bob
✓ sanity-lnd-alice-pays-bob (4538ms)
✓ sanity-lnd-alice-pays-bob-using-hold-invoice (4982ms)
(node:75643) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/sanity.ts (14.79s)
Sanity
✓ invalid-swap-yields-404 (1545ms)
✓ empty-swap-list-after-startup (1564ms)
✓ bad-request-for-invalid-swap-combination (1554ms)
✓ returns-invalid-body-for-bad-json (1548ms)
✓ alice-has-empty-peer-list (1534ms)
✓ returns-listen-addresses-on-root-document (1532ms)
✓ can-fetch-root-document-as-siren (1538ms)
✓ returns-listen-addresses-on-root-document-as-siren (1526ms)
✓ returns-links-to-create-swap-endpoints-on-root-document-as-siren (1558ms)
(node:75643) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/rfc003_schema.ts (10.072s)
Rfc003 schema tests
✓ get-all-swaps-is-valid-siren (1644ms)
✓ get-single-swap-is-valid-siren (1607ms)
✓ get-single-swap-contains-link-to-rfc (1577ms)
Rfc003 schema swap reject tests
✓ alice-can-make-default-swap-request (1684ms)
✓ bob-can-decline-swap (2664ms)
PASS tests/peers_using_ip.ts (7.907s)
Peers using IP tests
✓ alice-empty-peer-list (1682ms)
✓ alice-send-request-wrong-peer-id (2755ms)
✓ alice-send-swap-request-to-charlie (2658ms)
PASS tests/lightning_routes.ts (7.044s)
Lightning routes tests
✓ lightning-routes-post-eth-lnbtc-return-400 (1583ms)
✓ lightning-routes-post-erc20-lnbtc-return-400 (1549ms)
✓ lightning-routes-post-lnbtc-eth-return-400 (1533ms)
✓ lightning-routes-post-lnbtc-erc20-return-400 (1534ms)
PASS tests/multiple_peers.ts
Multiple peers tests
✓ alice-sends-swap-request-to-bob-and-charlie (2167ms)
(node:75641) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:75642) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit
PASS tests/ethereum_bitcoin.ts (194.992s)
E2E: Ethereum/ether - Bitcoin/bitcoin
✓ rfc003-eth-btc-alice-redeems-bob-redeems (24731ms)
✓ rfc003-eth-btc-alpha-deploy-fails (28902ms)
✓ rfc003-eth-btc-bob-refunds-alice-refunds (24071ms)
✓ rfc003-eth-btc-alice-redeems-with-high-fee (21309ms)
E2E: Ethereum/erc20 - Bitcoin/bitcoin
✓ rfc003-eth-erc20_btc-alice-redeems-bob-redeems (27916ms)
✓ rfc003-eth-erc20_btc-bob-refunds-alice-refunds (35000ms)
PASS tests/bitcoin_ethereum.ts (428.398s)
E2E: Bitcoin/bitcoin - Ethereum/ether
✓ rfc003-btc-eth-alice-redeems-bob-redeems (28881ms)
✓ rfc003-btc-eth-bob-refunds-alice-refunds (30342ms)
✓ rfc003-btc-eth-alice-refunds-bob-refunds (29885ms)
✓ rfc003-btc-eth-cnd-can-be-restarted (10116ms)
✓ rfc003-btc-eth-resume-alice-down-bob-funds (30733ms)
✓ rfc003-btc-eth-resume-alice-down-bob-redeems (24821ms)
✓ rfc003-btc-eth-resume-bob-down-alice-funds (25518ms)
✓ rfc003-btc-eth-resume-bob-down-alice-redeems (30600ms)
✓ rfc003-btc-eth-alice-underfunds-bob-aborts (33569ms)
✓ rfc003-btc-eth-bob-underfunds-both-refund (25510ms)
✓ rfc003-btc-eth-alice-overfunds-bob-aborts (33372ms)
✓ rfc003-btc-eth-bob-overfunds-both-refund (30352ms)
E2E: Bitcoin/bitcoin - Ethereum/erc20
✓ rfc003-btc-eth-erc20-alice-redeems-bob-redeems (35520ms)
✓ rfc003-btc-eth-erc20-bob-refunds-alice-refunds (33327ms)
Test Suites: 8 passed, 8 total
Tests: 44 passed, 44 total
Snapshots: 0 total
Time: 431.794s
Ran all test suites.
Found pid file bitcoind/bitcoind.pid, sending SIGINT to process with PID 75648
Found pid file lnd-alice/lnd.pid, sending SIGINT to process with PID 75652
Found pid file lnd-bob/lnd.pid, sending SIGINT to process with PID 75653
Found pid file parity/parity.pid, sending SIGINT to process with PID 75647
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished? |
Ignore the Lightning tests because I forgot to add I see some things that concern me:
Test results
|
I ran them twice with |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Ran it once, all green. Seems the first, successful, run on the latest commit of the branch did not properly clean-up Cleaned up, ran again, and the Do we share the Note: After the last, unsuccessful run |
That is expected. The lnd tests will fail if the instances are not cleanup properly because the new chain that lnd is connected to will be different every test. |
@da-kami can you run them repeatedly if you clean the instances manually between the test runs? |
I did clean them up after the second (unsuccessful) run, but then the third run still failed. |
I ran
|
To me it feels like they always run successful on the first try which hints that we don't clean up properly somewhere :/ But is running them one successfully good enough for us? |
Turns out, we only use the instance to get the data out again!
1. There was a bug in the previous code where we used `minus` instead of `plus`. 2. We can just use `.wait` here to do the same thing.
This is a left-over from previous times and no longer needed.
In some cases, we ran into errors where the log reader tried to read the file before it existed. Additionally, the design of `LogReader` suggested that its instance can actually be reuse, which is false. If the line we are looking for has been emitted in the log file before we start looking for it, we never find it. We circumvent both problems by removing the LogReader alltogether and only exposing a single function.
Parity has an auto-update mechanism where it actually downloads the latest version and executes that binary instead of the current one. It spawning a new process makes it impossible for us to kill it with the PID we got from starting it. The latest version (2.7.2 at this stage), seems to allow us to circumvent this probem with the --force-direct flag.
Bitcoind already logs to a file, there is not need for us to capture stdout and print it to a file again.
By utilizing file-locks on directories, we can ensure that any number of parallel test suites only ever get to run one instance of the ledger. The remaining test suites will take the config and pass that to the tests. We store the PID of each ledger in a file inside the lock directory, this also includes a sub-process that we spawn for the Bitcoin miner. This is important, because same as with the other nodes, this process must keep going until the last test executed. To cleanup our environment, we kill all processes with PIDs that we find in those PID files before and after we execute the tests, just in case if we for some reason did not exit cleanly and failed to cleanup after ourselves.
48fb9b0
to
599aee7
Compare
@thomaseizinger , @da-kami , @luckysori , @tcharding , @rishflab , @D4nte : I rebased and remove the |
bors r+ |
2289: Parallel e2e tests: Only start one instance of Parity, Bitcoind and one lnd per actor r=mergify[bot] a=thomaseizinger By utilizing file-locks on directories, we can ensure that any number of parallel test suites only ever get to run one instance of the ledger. The remaining test suites will take the config and pass that to the tests. We store the PID of each ledger in a file inside the lock directory, this also includes a sub-process that we spawn for the Bitcoin miner. This is important, because same as with the other nodes, this process must keep going until the last test executed. To cleanup our environment, we kill all processes with PIDs that we find in those PID files before and after we execute the tests, just in case if we for some reason did not exit cleanly and failed to cleanup after ourselves. ## What works: - Interrupting the test suite with CTRL+C cleans the enviornment - Running tests in parallel - Running an individual test - Nodes shut down after a successful run ## What doesn't work - A failing test will not clean up the environment Co-authored-by: Thomas Eizinger <thomas@eizinger.io> Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
Build failed |
bors retry |
Build succeeded |
Hahaha, now we HAVE to deal with it :D |
2307: Download blockchain nodes in TS instead of with shell scripts r=mergify[bot] a=thomaseizinger This is a follow-up PR after #2289 and should only be reviewed either after that one merged or starting from commit c4631e8. This PR removes the `blockchain_nodes` directory from the repository (it setting there has been bugging me for a while). We now download the necessary version of the blockchain nodes automatically when trying to start an instance of it. See the commit message for more details. Apart from it being a better design, this has the main advantage that we don't need to tell everyone to reset their blockchain_nodes folder when we update the version of a node for the e2e tests. Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
By utilizing file-locks on directories, we can ensure that any number
of parallel test suites only ever get to run one instance of
the ledger. The remaining test suites will take the config and
pass that to the tests.
We store the PID of each ledger in a file inside the lock directory,
this also includes a sub-process that we spawn for the Bitcoin miner.
This is important, because same as with the other nodes, this process
must keep going until the last test executed.
To cleanup our environment, we kill all processes with PIDs that we
find in those PID files before and after we execute the tests, just
in case if we for some reason did not exit cleanly and failed to
cleanup after ourselves.
What works:
What doesn't work