From c1eeba51e5992e02668ad8f961f46801976ab25a Mon Sep 17 00:00:00 2001
From: Esben Haabendal <esben@geanix.com>
Date: Wed, 29 Mar 2023 11:56:24 +0200
Subject: [PATCH] openharmony-standard: Drop a bunch of timing
 patches/workarounds

Alle these should hopefully not be needed anymore, with the workaround for the
race condition in ace engine.

Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 ...reabilitytest-wait-between-testcases.patch | 26 ------
 ...etwantalltest-wait-between-testcases.patch | 32 -------
 ...acts-start-ability-timeout-increment.patch | 41 ---------
 ...-xts-acts-testcase-timeout-increment.patch | 86 -------------------
 .../openharmony/openharmony-standard_3.0.bb   |  4 -
 5 files changed, 189 deletions(-)
 delete mode 100644 recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch
 delete mode 100644 recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch
 delete mode 100644 recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-start-ability-timeout-increment.patch
 delete mode 100644 recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch

diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch
deleted file mode 100644
index c8db5402..00000000
--- a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsfeatureabilitytest-wait-between-testcases.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc. 
-# 
-# SPDX-License-Identifier: Apache-2.0 
- 
-test/xts/acts/ActsFeatureAbilityTest: wait 8 seconds between each testcase
-
-sometimes feature abilities fail to start because the previous testcase
-still has't completely started or terminated its feature ability.
-Increasing sleep time from 1 seconds to 8 seconds between each testcase.
- 
-Upstream-Status: Pending 
- 
-Signed-off-by: Francesco Pham <francesco.pham@huawei.com> 
-diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
-index 10e517f2c..1abaccd94 100644
---- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
-+++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
-@@ -82,7 +82,7 @@ describe('ActsFeatureAbilityTest', function () {
-         }
-     }
-     beforeEach(() => {
--        sleep(1000);
-+        sleep(8000);
-     })
- 
-     /**
diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch
deleted file mode 100644
index ee8898ab..00000000
--- a/recipes-openharmony/openharmony/openharmony-standard-3.0/actsgetwantalltest-wait-between-testcases.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc. 
-# 
-# SPDX-License-Identifier: Apache-2.0 
- 
-test/xts/acts/ActsGetWantTest: wait 10 seconds between each testcase
-
-sometimes feature abilities fail to start because the previous testcase
-still has't completely started or terminated its feature ability.
-Adding a 10 seconds wait time between each testcase.
- 
-Upstream-Status: Pending 
- 
-Signed-off-by: Francesco Pham <francesco.pham@huawei.com> 
-diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js
-index 81a92cc7e..e75f90039 100644
---- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js
-+++ b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js
-@@ -34,6 +34,14 @@ describe('ActsGetWantTest', function () {
-         done();
-     })
- 
-+    beforeEach(async (done) => {
-+        console.debug("waiting 10 seconds between testcases");
-+        setTimeout(function(){
-+            console.debug("beforeEach end");
-+            done();
-+        },10000);
-+    })
-+
-     //  @tc.number: ACTS_GetWant_0100
-     //  @tc.name: getWant : get want in current ability
-     //  @tc.desc:Start the ability through startabilityforresult,
diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-start-ability-timeout-increment.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-start-ability-timeout-increment.patch
deleted file mode 100644
index a8161e11..00000000
--- a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-start-ability-timeout-increment.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc. 
-# 
-# SPDX-License-Identifier: Apache-2.0 
- 
-current START_ABILITY_TIMEOUT is too short, causing some  
-testcases in ActsBmsModuleUsageRecordTest and FeatureAbilityJsunit to 
-exceed timeout.
-Increasing the timeout to 15 seconds. 
-
-Apply to test/xts/acts
- 
-Upstream-Status: Pending 
- 
-Signed-off-by: Francesco Pham <francesco.pham@huawei.com> 
-
-diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
-index b2a603467..50d9ac07d 100644
---- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
-+++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
-@@ -17,7 +17,7 @@ import wantconstant from '@ohos.ability.wantConstant'
- import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
- import commonEvent from '@ohos.commonevent'
- 
--const START_ABILITY_TIMEOUT = 4000;
-+const START_ABILITY_TIMEOUT = 15000;
- const TERMINATE_ABILITY_TIMEOUT = 1000;
- const TIMEOUT = 1000;
- var subscriberInfo_ACTS_StartAbility_0100 = {
-diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
-index d4068900a..1510b6608 100644
---- a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
-+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
-@@ -24,7 +24,7 @@ const BUNDLE_NAME = 'com.example.third1';
- const NUM_TWO = 2;
- const NUM_TEN = 10;
- const INVALID_NUM = -1;
--const START_ABILITY_TIMEOUT = 3000;
-+const START_ABILITY_TIMEOUT = 15000;
- const START_RECORD = 900;
- const TIMEOUT = 3000;
- 
diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch
deleted file mode 100644
index 1b3ae4c4..00000000
--- a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testcase-timeout-increment.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: Apache-2.0
-
-The default test timeout is 5000ms which is too short, causing some testcases
-to exceed timeout. Increasing the timeout to 20 seconds.
-
-Apply to test/xts/acts
-
-Upstream-Status: Pending
-
-Signed-off-by: Francesco Pham <francesco.pham@huawei.com>
-
-diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js
-index 095743b34..ecffc80a9 100644
---- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js
-+++ b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js
-@@ -36,6 +36,7 @@ export default {
-         core.init()
- 
-         const configService = core.getDefaultService('config')
-+        this.timeout = 20000
-         configService.setConfig(this)
- 
-         require('../../../test/List.test')
-diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js
-index 362bbb390..2cec00ce8 100644
---- a/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js
-+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/default/pages/index/index.js
-@@ -31,6 +31,7 @@ export default {
-         core.addService('expect', expectExtend)
-         core.init()
-         const configService = core.getDefaultService('config')
-+        this.timeout = 20000
-         configService.setConfig(this)
- 
-         require('../../../test/List.test')
-diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
-index 6bb4ad1c3..216571d89 100644
---- a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
-+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
-@@ -31,6 +31,7 @@ export default {
-         core.addService('expect', expectExtend)
-         core.init()
-         const configService = core.getDefaultService('config')
-+        this.timeout = 20000
-         configService.setConfig(this)
- 
-         require('../../../test/List.test.js')
-diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js
-index 9b47685ef..f06cde28f 100644
---- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js
-+++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/default/pages/index/index.js
-@@ -32,6 +32,7 @@ export default {
-         core.addService('expect', expectExtend)
-         core.init()
-         const configService = core.getDefaultService('config')
-+        this.timeout = 20000
-         configService.setConfig(this)
- 
-         require('../../../test/List.test')
-diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js
-index 398d8b4d7..31f6f45f6 100644
---- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js
-+++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/default/pages/index/index.js
-@@ -31,6 +31,7 @@ export default {
-         core.addService('expect', expectExtend)
-         core.init()
-         const configService = core.getDefaultService('config')
-+        this.timeout = 20000
-         configService.setConfig(this)
- 
-         require('../../../test/List.test')
-
-diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js
-index 604c4fe49..c6acf358d 100644
---- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js
-+++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js
-@@ -33,6 +33,7 @@ export default {
-         core.addService('expect', expectExtend)
-         core.init()
-         const configService = core.getDefaultService('config')
-+        this.timeout = 20000
-         configService.setConfig(this)
- 
-         require('../../../test/List.test')
diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
index 77d2f1d2..3a09c024 100644
--- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
+++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
@@ -94,14 +94,10 @@ SRC_URI += "file://hisysevent-socket-path.patch;patchdir=${S}/base/hiviewdfx/his
 # Patch to allow /system/profile and /system/usr to be symlinks to /usr/lib/openharmony
 SRC_URI += "file://foundation_distributedschedule_safwk-slash-system-symlink.patch;patchdir=${S}/foundation/distributedschedule/safwk"
 
-SRC_URI += "file://test-xts-acts-testcase-timeout-increment.patch;patchdir=${S}/test/xts/acts"
-SRC_URI += "file://test-xts-acts-start-ability-timeout-increment.patch;patchdir=${S}/test/xts/acts"
 SRC_URI += "file://test-xts-acts-fix-Defpermission-typo.patch;patchdir=${S}/test/xts/acts"
 SRC_URI += "file://test-xts-acts-fix-faultloggertest.patch;patchdir=${S}/test/xts/acts"
 SRC_URI += "file://test-xts-acts-fix-hicolliecpptest.patch;patchdir=${S}/test/xts/acts"
 SRC_URI += "file://test-xts-acts-increase-testsuite-timeouts.patch;patchdir=${S}/test/xts/acts"
-SRC_URI += "file://actsgetwantalltest-wait-between-testcases.patch;patchdir=${S}/test/xts/acts"
-SRC_URI += "file://actsfeatureabilitytest-wait-between-testcases.patch;patchdir=${S}/test/xts/acts"
 SRC_URI += "file://foundation_ace_engine-race-condition-workaround.patch;patchdir=${S}/foundation/ace/ace_engine"
 
 inherit python3native gn_base ptest
-- 
GitLab