summaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2022-03-04 13:38:36 +0000
committerHåvard Pettersen <havardpe@oath.com>2022-03-05 15:00:58 +0000
commit2681bcd99a024d0e94c2cddd08b7636818773a73 (patch)
treefe8466205ba79ea6b7ab89008247070f88cd918f /vespamalloc
parentbeed3becc8ec1abe88aea8aa88e6e703fb67dc3c (diff)
gc old process code
also added read_line function to new Process code
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/tests/doubledelete/expectsignal.cpp14
-rw-r--r--vespamalloc/src/tests/overwrite/expectsignal.cpp13
-rw-r--r--vespamalloc/src/tests/thread/thread.cpp2
3 files changed, 8 insertions, 21 deletions
diff --git a/vespamalloc/src/tests/doubledelete/expectsignal.cpp b/vespamalloc/src/tests/doubledelete/expectsignal.cpp
index e9b71649268..df6398dcd20 100644
--- a/vespamalloc/src/tests/doubledelete/expectsignal.cpp
+++ b/vespamalloc/src/tests/doubledelete/expectsignal.cpp
@@ -1,6 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/child_process.h>
+#include <vespa/vespalib/process/process.h>
#include <sys/wait.h>
using namespace vespalib;
@@ -9,9 +9,6 @@ class Test : public TestApp
{
public:
int Main() override;
-private:
- bool useProcessStarter() const override { return true; }
-
};
int Test::Main()
@@ -25,14 +22,11 @@ int Test::Main()
fprintf(stderr, "argc=%d : Running '%s' expecting signal %d\n", _argc, _argv[2], retval);
- ChildProcess cmd(_argv[2]);
- for(std::string line; cmd.readLine(line, 60000);) {
+ Process cmd(_argv[2]);
+ for (vespalib::string line = cmd.read_line(); !line.empty(); line = cmd.read_line()) {
fprintf(stdout, "%s\n", line.c_str());
}
-
- ASSERT_TRUE(cmd.wait(60000));
-
- int exitCode = cmd.getExitCode();
+ int exitCode = cmd.join();
if (exitCode == 65535) {
fprintf(stderr, "[ERROR] child killed (timeout)\n");
diff --git a/vespamalloc/src/tests/overwrite/expectsignal.cpp b/vespamalloc/src/tests/overwrite/expectsignal.cpp
index 904cedd479f..df6398dcd20 100644
--- a/vespamalloc/src/tests/overwrite/expectsignal.cpp
+++ b/vespamalloc/src/tests/overwrite/expectsignal.cpp
@@ -1,6 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/child_process.h>
+#include <vespa/vespalib/process/process.h>
#include <sys/wait.h>
using namespace vespalib;
@@ -9,8 +9,6 @@ class Test : public TestApp
{
public:
int Main() override;
-private:
- virtual bool useProcessStarter() const override { return true; }
};
int Test::Main()
@@ -24,14 +22,11 @@ int Test::Main()
fprintf(stderr, "argc=%d : Running '%s' expecting signal %d\n", _argc, _argv[2], retval);
- ChildProcess cmd(_argv[2]);
- for(std::string line; cmd.readLine(line, 60000);) {
+ Process cmd(_argv[2]);
+ for (vespalib::string line = cmd.read_line(); !line.empty(); line = cmd.read_line()) {
fprintf(stdout, "%s\n", line.c_str());
}
-
- ASSERT_TRUE(cmd.wait(60000));
-
- int exitCode = cmd.getExitCode();
+ int exitCode = cmd.join();
if (exitCode == 65535) {
fprintf(stderr, "[ERROR] child killed (timeout)\n");
diff --git a/vespamalloc/src/tests/thread/thread.cpp b/vespamalloc/src/tests/thread/thread.cpp
index b101b862268..d6f1ad5c9c0 100644
--- a/vespamalloc/src/tests/thread/thread.cpp
+++ b/vespamalloc/src/tests/thread/thread.cpp
@@ -11,8 +11,6 @@ class Test : public TestApp
public:
~Test();
int Main() override;
-private:
- bool useIPCHelper() const override { return true; }
};
Test::~Test()