From b827cebd89de76b430e44eca55639971d210a3fc Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Thu, 15 Sep 2022 05:36:30 +0300 Subject: [PATCH] always kill sandbox process (#220) * always kill sandbox process * after() -> after.always() --- examples/__tests__/test-clean-state.ava.js | 2 +- examples/__tests__/test-counter.ava.js | 2 +- examples/__tests__/test-cross-contract-call.ava.js | 2 +- examples/__tests__/test-fungible-token-lockable.ava.js | 2 +- examples/__tests__/test-fungible-token.ava.js | 2 +- examples/__tests__/test-non-fungible-token.ava.js | 2 +- examples/__tests__/test-parking-lot.ava.js | 2 +- examples/__tests__/test-status-message-collections.ava.js | 2 +- examples/__tests__/test-status-message.ava.js | 2 +- tests/__tests__/bytes.ava.js | 2 +- tests/__tests__/decorators/near_bindgen.ava.js | 2 +- tests/__tests__/decorators/payable.ava.js | 2 +- tests/__tests__/decorators/private.ava.js | 2 +- tests/__tests__/function-params.ava.js | 2 +- tests/__tests__/lookup-map.ava.js | 2 +- tests/__tests__/lookup-set.ava.js | 2 +- tests/__tests__/test-public-key.ava.js | 2 +- tests/__tests__/test_context_api.ava.js | 2 +- tests/__tests__/test_highlevel_promise.ava.js | 2 +- tests/__tests__/test_log_panic_api.ava.js | 2 +- tests/__tests__/test_math_api.ava.js | 2 +- tests/__tests__/test_promise_api.ava.js | 2 +- tests/__tests__/test_storage_api.ava.js | 2 +- tests/__tests__/typescript.ava.js | 2 +- tests/__tests__/unordered-map.ava.js | 2 +- tests/__tests__/unordered-set.ava.js | 2 +- tests/__tests__/vector.ava.js | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/examples/__tests__/test-clean-state.ava.js b/examples/__tests__/test-clean-state.ava.js index bb717976e..31f5e07c4 100644 --- a/examples/__tests__/test-clean-state.ava.js +++ b/examples/__tests__/test-clean-state.ava.js @@ -19,7 +19,7 @@ test.beforeEach(async t => { }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed tear down the worker:', error); }); diff --git a/examples/__tests__/test-counter.ava.js b/examples/__tests__/test-counter.ava.js index ca1bb26d8..8a6964809 100644 --- a/examples/__tests__/test-counter.ava.js +++ b/examples/__tests__/test-counter.ava.js @@ -26,7 +26,7 @@ test.beforeEach(async t => { }); // If the environment is reused, use test.after to replace test.afterEach -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/examples/__tests__/test-cross-contract-call.ava.js b/examples/__tests__/test-cross-contract-call.ava.js index d0b7c0758..4b3666984 100644 --- a/examples/__tests__/test-cross-contract-call.ava.js +++ b/examples/__tests__/test-cross-contract-call.ava.js @@ -36,7 +36,7 @@ test.beforeEach(async t => { }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed tear down the worker:', error); }); diff --git a/examples/__tests__/test-fungible-token-lockable.ava.js b/examples/__tests__/test-fungible-token-lockable.ava.js index 39350e8b6..5481f8b23 100644 --- a/examples/__tests__/test-fungible-token-lockable.ava.js +++ b/examples/__tests__/test-fungible-token-lockable.ava.js @@ -25,7 +25,7 @@ test.beforeEach(async t => { t.context.accounts = { root, lockableFt, ali, bob }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/examples/__tests__/test-fungible-token.ava.js b/examples/__tests__/test-fungible-token.ava.js index 6e147449b..7cab26dee 100644 --- a/examples/__tests__/test-fungible-token.ava.js +++ b/examples/__tests__/test-fungible-token.ava.js @@ -28,7 +28,7 @@ test.beforeEach(async (t) => { t.context.accounts = { root, ft, ali, bob, xcc }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed tear down the worker:', error); }); diff --git a/examples/__tests__/test-non-fungible-token.ava.js b/examples/__tests__/test-non-fungible-token.ava.js index f143774c3..6f8970506 100644 --- a/examples/__tests__/test-non-fungible-token.ava.js +++ b/examples/__tests__/test-non-fungible-token.ava.js @@ -38,7 +38,7 @@ test.beforeEach(async t => { t.context.accounts = { root, nft, tokenReceiver, tokenId, ali, bob }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed tear down the worker:', error); }); diff --git a/examples/__tests__/test-parking-lot.ava.js b/examples/__tests__/test-parking-lot.ava.js index f2e755fcd..af1d3b3a4 100644 --- a/examples/__tests__/test-parking-lot.ava.js +++ b/examples/__tests__/test-parking-lot.ava.js @@ -16,7 +16,7 @@ test.beforeEach(async t => { t.context.accounts = { root, parkingLot, ali }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/examples/__tests__/test-status-message-collections.ava.js b/examples/__tests__/test-status-message-collections.ava.js index b13056cff..ab1ba23a0 100644 --- a/examples/__tests__/test-status-message-collections.ava.js +++ b/examples/__tests__/test-status-message-collections.ava.js @@ -24,7 +24,7 @@ test.beforeEach(async t => { t.context.accounts = { root, statusMessage, ali, bob, carl }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/examples/__tests__/test-status-message.ava.js b/examples/__tests__/test-status-message.ava.js index 28dd92f53..9310cf02e 100644 --- a/examples/__tests__/test-status-message.ava.js +++ b/examples/__tests__/test-status-message.ava.js @@ -23,7 +23,7 @@ test.before(async t => { t.context.accounts = { root, statusMessage, ali, bob, carl }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/bytes.ava.js b/tests/__tests__/bytes.ava.js index 53146759b..af0964d6e 100644 --- a/tests/__tests__/bytes.ava.js +++ b/tests/__tests__/bytes.ava.js @@ -20,7 +20,7 @@ test.beforeEach(async t => { t.context.accounts = { root, bytesContract, ali }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/decorators/near_bindgen.ava.js b/tests/__tests__/decorators/near_bindgen.ava.js index 03169ff83..048e813ee 100644 --- a/tests/__tests__/decorators/near_bindgen.ava.js +++ b/tests/__tests__/decorators/near_bindgen.ava.js @@ -19,7 +19,7 @@ test.beforeEach(async t => { }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/decorators/payable.ava.js b/tests/__tests__/decorators/payable.ava.js index 44c3c2940..8b2833e41 100644 --- a/tests/__tests__/decorators/payable.ava.js +++ b/tests/__tests__/decorators/payable.ava.js @@ -19,7 +19,7 @@ test.beforeEach(async t => { }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/decorators/private.ava.js b/tests/__tests__/decorators/private.ava.js index 69b4fa509..14f675ca5 100644 --- a/tests/__tests__/decorators/private.ava.js +++ b/tests/__tests__/decorators/private.ava.js @@ -17,7 +17,7 @@ test.beforeEach(async t => { }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/function-params.ava.js b/tests/__tests__/function-params.ava.js index b86071beb..01cb0555e 100644 --- a/tests/__tests__/function-params.ava.js +++ b/tests/__tests__/function-params.ava.js @@ -23,7 +23,7 @@ test.before(async t => { t.context.accounts = { root, functionParamsContract, ali, bob, carl }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/lookup-map.ava.js b/tests/__tests__/lookup-map.ava.js index 45a6b870f..2cc8b4714 100644 --- a/tests/__tests__/lookup-map.ava.js +++ b/tests/__tests__/lookup-map.ava.js @@ -23,7 +23,7 @@ test.beforeEach(async t => { t.context.accounts = { root, lookupMapContract, ali, bob, carl }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/lookup-set.ava.js b/tests/__tests__/lookup-set.ava.js index 166b34e5b..4e2a2024a 100644 --- a/tests/__tests__/lookup-set.ava.js +++ b/tests/__tests__/lookup-set.ava.js @@ -22,7 +22,7 @@ test.beforeEach(async t => { t.context.accounts = { root, lookupSetContract, ali, bob, carl }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test-public-key.ava.js b/tests/__tests__/test-public-key.ava.js index 6c576b531..36d5aa68c 100644 --- a/tests/__tests__/test-public-key.ava.js +++ b/tests/__tests__/test-public-key.ava.js @@ -23,7 +23,7 @@ test.before(async t => { t.context.accounts = { root, pkContract, ali, bob, carl }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test_context_api.ava.js b/tests/__tests__/test_context_api.ava.js index 8ff41c078..a2517d44d 100644 --- a/tests/__tests__/test_context_api.ava.js +++ b/tests/__tests__/test_context_api.ava.js @@ -24,7 +24,7 @@ test.before(async t => { t.context.accounts = { root, contextApiContract, ali, bob, carl }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test_highlevel_promise.ava.js b/tests/__tests__/test_highlevel_promise.ava.js index 57c0544ba..d732f96ab 100644 --- a/tests/__tests__/test_highlevel_promise.ava.js +++ b/tests/__tests__/test_highlevel_promise.ava.js @@ -25,7 +25,7 @@ test.before(async t => { t.context.accounts = { root, highlevelPromise, ali, bob, calleeContract }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test_log_panic_api.ava.js b/tests/__tests__/test_log_panic_api.ava.js index 59700165b..14a605847 100644 --- a/tests/__tests__/test_log_panic_api.ava.js +++ b/tests/__tests__/test_log_panic_api.ava.js @@ -22,7 +22,7 @@ test.before(async t => { t.context.accounts = { root, testContract, ali }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test_math_api.ava.js b/tests/__tests__/test_math_api.ava.js index ec04bd999..9f2fdaee4 100644 --- a/tests/__tests__/test_math_api.ava.js +++ b/tests/__tests__/test_math_api.ava.js @@ -21,7 +21,7 @@ test.before(async t => { t.context.accounts = { root, mathApiContract, ali }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test_promise_api.ava.js b/tests/__tests__/test_promise_api.ava.js index 7c836dc63..3dec7defe 100644 --- a/tests/__tests__/test_promise_api.ava.js +++ b/tests/__tests__/test_promise_api.ava.js @@ -30,7 +30,7 @@ test.before(async t => { t.context.accounts = { root, callerContract, calleeContract, ali, bob, caller2Contract }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/test_storage_api.ava.js b/tests/__tests__/test_storage_api.ava.js index 3b91110be..88a7d2d4c 100644 --- a/tests/__tests__/test_storage_api.ava.js +++ b/tests/__tests__/test_storage_api.ava.js @@ -22,7 +22,7 @@ test.beforeEach(async t => { t.context.accounts = { root, storageApiContract, ali }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/typescript.ava.js b/tests/__tests__/typescript.ava.js index a6a327bcc..dbdf5e493 100644 --- a/tests/__tests__/typescript.ava.js +++ b/tests/__tests__/typescript.ava.js @@ -20,7 +20,7 @@ test.before(async t => { t.context.accounts = { root, typescriptContract, ali }; }); -test.after(async t => { +test.after.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/unordered-map.ava.js b/tests/__tests__/unordered-map.ava.js index 8608c4950..c3e532ef1 100644 --- a/tests/__tests__/unordered-map.ava.js +++ b/tests/__tests__/unordered-map.ava.js @@ -22,7 +22,7 @@ test.beforeEach(async t => { t.context.accounts = { root, unorderedMapContract, ali, bob, carl }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/unordered-set.ava.js b/tests/__tests__/unordered-set.ava.js index a7317672c..a42fae7d7 100644 --- a/tests/__tests__/unordered-set.ava.js +++ b/tests/__tests__/unordered-set.ava.js @@ -23,7 +23,7 @@ test.beforeEach(async t => { t.context.accounts = { root, unorderedSetContract, ali, bob, carl }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); }); diff --git a/tests/__tests__/vector.ava.js b/tests/__tests__/vector.ava.js index 0dc0ab1ff..d805c97ba 100644 --- a/tests/__tests__/vector.ava.js +++ b/tests/__tests__/vector.ava.js @@ -23,7 +23,7 @@ test.beforeEach(async t => { t.context.accounts = { root, vectorContract, ali, bob, carl }; }); -test.afterEach(async t => { +test.afterEach.always(async t => { await t.context.worker.tearDown().catch(error => { console.log('Failed to tear down the worker:', error); });