[
https://issues.apache.org/jira/browse/GEODE-9325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17496288#comment-17496288
]
ASF GitHub Bot commented on GEODE-9325:
---------------------------------------
pdxcodemonkey commented on a change in pull request #813:
URL: https://github.com/apache/geode-native/pull/813#discussion_r812303575
##########
File path: cppcache/integration-test/fw_dunit.cpp
##########
@@ -361,19 +355,48 @@ void Task::setTimeout(int seconds) {
}
}
-class TestProcess : virtual public dunit::Manager {
- private:
- WorkerId m_sId;
-
+class TestProcess {
public:
TestProcess(const std::string &cmdline, uint32_t id)
- : Manager(cmdline), m_sId(id) {}
+ : id_{id}, running_{false}, cmd_{cmdline} {}
- WorkerId &getWorkerId() { return m_sId; }
+ WorkerId &getWorkerId() { return id_; }
+
+ void run() {
+ auto arguments = bpo::split_unix(cmd_);
+
+ std::string exe = arguments[0];
+ arguments.erase(arguments.begin());
+ process_ = bp::child(exe, bp::args = arguments);
+
+ process_.wait();
+ if (process_.exit_code() != 0) {
+ std::clog << "Worker " << id_.getIdName() << " exited with code "
+ << process_.exit_code() << std::endl;
+ }
+
+ running_ = false;
+ }
+
+ void start() {
+ running_ = true;
+ thread_ = std::thread{[this]() { run(); }};
+ }
+
+ void stop() {
+ if (thread_.joinable()) {
+ thread_.join();
+ }
+ }
+
+ bool running() const { return running_; }
Review comment:
Thanks for the explanation! I've never delved very deep into the old
test code, so this is great stuff to learn. I don't think we need to worry
about making this any more deterministic. I kind of suspect this change will
help some in that regard, anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
> Remove ACE_Process references
> -----------------------------
>
> Key: GEODE-9325
> URL: https://issues.apache.org/jira/browse/GEODE-9325
> Project: Geode
> Issue Type: Improvement
> Components: native client
> Reporter: Mario Salazar de Torres
> Assignee: Mario Salazar de Torres
> Priority: Major
> Labels: obliterate-ace, pull-request-available
>
> *AS A* native client contributor
> *I WANT TO* remove all remaining references to ACE_Process
> *SO THAT* eventually we can get rid of ACE library
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)