From a851108ff37d5fb93536ad06912a75997e04d66c Mon Sep 17 00:00:00 2001
From: Francesco Pham <francesco.pham@huawei.com>
Date: Tue, 28 Mar 2023 12:14:22 +0200
Subject: [PATCH] openharmony-standard:
 testRdbStoreUpdate0001-await-updatePromise.patch

adding test-xts-acts-testRdbStoreUpdate0001-await-updatePromise.patch and apply to test/xts/acts .

```
The testRdbStoreUpdate0001 testcase which is part of ActsAppdatamagrJsTest
sometimes fails (in our case on raspberrypi4-64). The reason is that
the values in rdbStore are inspected before the update is completed.
The `await updatePromise` command that is clearly needed was commented out
for some unknown reason. Reintroducing the await command to avoid race
conditions.
```

Signed-off-by: Francesco Pham <francesco.pham@huawei.com>
---
 ...bStoreUpdate0001-await-updatePromise.patch | 37 +++++++++++++++++++
 .../openharmony/openharmony-standard_3.0.bb   |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testRdbStoreUpdate0001-await-updatePromise.patch

diff --git a/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testRdbStoreUpdate0001-await-updatePromise.patch b/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testRdbStoreUpdate0001-await-updatePromise.patch
new file mode 100644
index 00000000..bc958d6f
--- /dev/null
+++ b/recipes-openharmony/openharmony/openharmony-standard-3.0/test-xts-acts-testRdbStoreUpdate0001-await-updatePromise.patch
@@ -0,0 +1,37 @@
+# SPDX-FileCopyrightText: Huawei Inc. 
+# 
+# SPDX-License-Identifier: Apache-2.0 
+ 
+The testRdbStoreUpdate0001 testcase which is part of ActsAppdatamagrJsTest 
+sometimes fails (in our case on raspberrypi4-64). The reason is that  
+the values in rdbStore are inspected before the update is completed. 
+The `await updatePromise` command that is clearly needed was commented out 
+for some unknown reason. Reintroducing the await command to avoid race  
+conditions. 
+ 
+Apply to test/xts/acts 
+ 
+Upstream-Status: Pending 
+ 
+Signed-off-by: Francesco Pham <francesco.pham@huawei.com> 
+
+diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js
+index ce3da461e..b3db7a2ae 100644
+--- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js
++++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreUpdateJsunit.test.js
+@@ -88,7 +88,7 @@ describe('rdbStoreUpdateTest', function () {
+                 console.log(TAG + "update error");
+                 expect(null).assertFail();
+             })
+-            //await updatePromise
++            await updatePromise
+         }
+         //查询
+         {
+@@ -262,4 +262,4 @@ describe('rdbStoreUpdateTest', function () {
+     })
+     console.log(TAG + "*************Unit Test End*************");
+ })
+-  
+\ No newline at end of file
++  
diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
index 53a33517..0ae43e0f 100644
--- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
+++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb
@@ -100,6 +100,7 @@ SRC_URI += "file://test-xts-acts-fix-hicolliecpptest.patch;patchdir=${S}/test/xt
 SRC_URI += "file://ace_engine-disable-create-component.patch;patchdir=${S}/foundation/ace/ace_engine"
 SRC_URI += "file://test-xts-acts-increase-testsuite-timeouts.patch;patchdir=${S}/test/xts/acts"
 SRC_URI += "file://foundation_ace_engine-race-condition-workaround.patch;patchdir=${S}/foundation/ace/ace_engine"
+SRC_URI += "file://test-xts-acts-testRdbStoreUpdate0001-await-updatePromise.patch;patchdir=${S}/test/xts/acts"
 
 inherit python3native gn_base ptest
 
-- 
GitLab