From f94dc22f335ae68b77f2dc172ddc1da7c44a1a84 Mon Sep 17 00:00:00 2001 From: liuhaonan2 Date: Fri, 3 Mar 2023 16:34:48 +0800 Subject: [PATCH] Signed-off-by: liuhaonan2 --- .../distributedKVStorejstest/hap/Test.json | 1 - .../src/main/js/test/KvStoreBackupCallbackJsTest.js | 10 ++++------ .../hap/src/main/js/test/KvStoreBackupPromiseJsTest.js | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/Test.json b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/Test.json index 2e5594691..11d07ca2a 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/Test.json +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/Test.json @@ -3,7 +3,6 @@ "driver": { "type": "OHJSUnitTest", "test-timeout": "1200000", - "testcase-timeout": 60000, "bundle-name": "ohos.acts.distributedKvStore", "package-name": "ohos.acts.distributedKvStore", "shell-timeout": "60000" diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js index 1926ba7b8..d58ac80fb 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupCallbackJsTest.js @@ -184,7 +184,6 @@ describe('kvStoreBackupCallbackJsunittest', function () { console.info('Test beforeAll: Prerequisites at the test suite level, ' + 'which are executed before t he test suite is executed.'); await publicgetKvStore(optionLock); - await sleep(5000); console.info("Test kvstore = " + kvStore) }) beforeEach( async function () { @@ -195,15 +194,14 @@ describe('kvStoreBackupCallbackJsunittest', function () { afterEach( async function () { console.info('afterEach: Test case-level clearance conditions, ' + 'which are executed after each test case is executed.'); - publicdeleteBackup(kvStore,files); - publiccloseKvStore(); + await publicdeleteBackup(kvStore,files); + await publiccloseKvStore(); files = [] - await sleep(5000); }) - afterAll(function () { + afterAll(async function () { console.info('afterAll: Test suite-level cleanup condition, ' + 'which is executed after the test suite is executed'); - publiccloseKvStore(); + await publiccloseKvStore(); kvManager = null; console.info("Test kvstore = " + kvStore) }) diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js index a27b43441..2ff960b20 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvStoreBackupPromiseJsTest.js @@ -175,7 +175,6 @@ describe('kvStoreBackupPromiseJsunittest', function () { console.info('Test beforeAll: Prerequisites at the test suite level, ' + 'which are executed before the test suite is executed.'); await publicgetKvStore(optionLock); - await sleep(5000); console.info("Test kvstore = " + kvStore) }) beforeEach(function () { @@ -185,13 +184,12 @@ describe('kvStoreBackupPromiseJsunittest', function () { afterEach( async function () { console.info('afterEach: Test case-level clearance conditions, ' + 'which are executed after each test case is executed.'); - publicdeleteBackup(kvStore,files); - await sleep(5000); + await publicdeleteBackup(kvStore,files); }) afterAll( async function () { console.info('afterAll: Test suite-level cleanup condition, ' + 'which is executed after the test suite is executed'); - publiccloseKvStore(); + await publiccloseKvStore(); kvManager = null; console.info("Test kvstore = " + kvStore) }) -- GitLab