This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch feature/split_celix_cxx_option
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to refs/heads/feature/split_celix_cxx_option
by this push:
new 7d03c5d5 Refactor RemoteServicesIntegrationTestSuite to retry remote
promise
7d03c5d5 is described below
commit 7d03c5d558a855804e7f280f2a177d29eb674e05
Author: Pepijn Noltes <[email protected]>
AuthorDate: Sun Dec 4 17:27:00 2022 +0100
Refactor RemoteServicesIntegrationTestSuite to retry remote promise
---
.../gtest/src/RemoteServicesIntegrationTestSuite.cc | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git
a/bundles/cxx_remote_services/integration/gtest/src/RemoteServicesIntegrationTestSuite.cc
b/bundles/cxx_remote_services/integration/gtest/src/RemoteServicesIntegrationTestSuite.cc
index d7bd87d9..38fc08c8 100644
---
a/bundles/cxx_remote_services/integration/gtest/src/RemoteServicesIntegrationTestSuite.cc
+++
b/bundles/cxx_remote_services/integration/gtest/src/RemoteServicesIntegrationTestSuite.cc
@@ -136,9 +136,17 @@ TEST_F(RemoteServicesIntegrationTestSuite,
InvokeRemoteCalcService) {
EXPECT_GE(streamCount,0 );
EXPECT_GE(lastValue, 0.0);
- //note, because stream event is received the pubsub connection
is ensured to be connected.
auto promise = calc.add(2, 4);
promise.wait();
+ start = std::chrono::system_clock::now();
+ elapsed = std::chrono::system_clock::now() - start;
+ while (!promise.isSuccessfullyResolved() && elapsed <
std::chrono::seconds{5}) {
+ //assuming failure, because pubsub connection is not fully
established (needs both ends)
+ std::this_thread::sleep_for(std::chrono::milliseconds{10});
+ promise = calc.add(2, 4);
+ promise.wait();
+ elapsed = std::chrono::system_clock::now() - start;
+ }
EXPECT_TRUE(promise.isSuccessfullyResolved());
if (promise.isSuccessfullyResolved()) {
EXPECT_EQ(6, promise.getValue());