summaryrefslogtreecommitdiffstats
path: root/config/src/tests/file_acquirer/file_acquirer_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'config/src/tests/file_acquirer/file_acquirer_test.cpp')
-rw-r--r--config/src/tests/file_acquirer/file_acquirer_test.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/config/src/tests/file_acquirer/file_acquirer_test.cpp b/config/src/tests/file_acquirer/file_acquirer_test.cpp
index f289e42edcb..7daafc37fcf 100644
--- a/config/src/tests/file_acquirer/file_acquirer_test.cpp
+++ b/config/src/tests/file_acquirer/file_acquirer_test.cpp
@@ -3,12 +3,16 @@
#include <vespa/config/file_acquirer/file_acquirer.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/fnet/frt/rpcrequest.h>
+#include <vespa/fnet/transport.h>
+#include <vespa/fastos/thread.h>
#include <vespa/vespalib/util/stringfmt.h>
using namespace config;
struct ServerFixture : FRT_Invokable {
fnet::frt::StandaloneFRT server;
+ FastOS_ThreadPool threadPool;
+ FNET_Transport transport;
FRT_Supervisor &orb;
vespalib::string spec;
@@ -20,10 +24,16 @@ struct ServerFixture : FRT_Invokable {
rb.ReturnDesc("file_path", "actual path to the requested file");
}
- ServerFixture() : server(), orb(server.supervisor()) {
+ ServerFixture()
+ : server(),
+ threadPool(64_Ki),
+ transport(),
+ orb(server.supervisor())
+ {
init_rpc();
orb.Listen(0);
spec = vespalib::make_string("tcp/localhost:%d", orb.GetListenPort());
+ transport.Start(&threadPool);
}
void RPC_waitFor(FRT_RPCRequest *req) {
@@ -36,10 +46,12 @@ struct ServerFixture : FRT_Invokable {
}
}
- ~ServerFixture() = default;
+ ~ServerFixture() {
+ transport.ShutDown(true);
+ }
};
-TEST_FF("require that files can be acquired over rpc", ServerFixture(), RpcFileAcquirer(f1.spec)) {
+TEST_FF("require that files can be acquired over rpc", ServerFixture(), RpcFileAcquirer(f1.transport, f1.spec)) {
EXPECT_EQUAL("my_path", f2.wait_for("my_ref", 60.0));
EXPECT_EQUAL("", f2.wait_for("bogus_ref", 60.0));
}