[ledger][testing] Don't exit instance provider.
`exit` was an (incorrect) attempt to prevent the instance provider from
being alive too long.
Now, the instance provider is expected to be cleaned-up by the Component
Controller with which it is launched.
TEST=Run tests that uses the instance provider.
Notice that `fx shell ps | grep ledger | wc -l` returns 0.
Change-Id: Iaed522d3fce5a8b2c588f76a525ec4b196bce518
diff --git a/bin/ledger/testing/ledger_test_instance_provider/README.md b/bin/ledger/testing/ledger_test_instance_provider/README.md
index d6bbd36..3f28e73 100644
--- a/bin/ledger/testing/ledger_test_instance_provider/README.md
+++ b/bin/ledger/testing/ledger_test_instance_provider/README.md
@@ -1,7 +1,7 @@
# Ledger Test Instance Provider
This is a package containing a `ledger_test_instance_provider_bin` binary whose
-purpose is to return a single Ledger instance backed by memfs.
+purpose is to return Ledger instances backed by memfs.
It exists to allow tests built outside of peridot to get access to a Ledger
instance, a task otherwise impossible because the required API
diff --git a/bin/ledger/testing/ledger_test_instance_provider/ledger_test_instance_provider.cc b/bin/ledger/testing/ledger_test_instance_provider/ledger_test_instance_provider.cc
index 8cf5fc8..b7158e8 100644
--- a/bin/ledger/testing/ledger_test_instance_provider/ledger_test_instance_provider.cc
+++ b/bin/ledger/testing/ledger_test_instance_provider/ledger_test_instance_provider.cc
@@ -24,7 +24,6 @@
} // namespace
// Exposes a public service that serves an in-memory Ledger.
-// Exits once the Ledger is served.
int main(int argc, char const *argv[]) {
async::Loop loop(&kAsyncLoopConfigAttachToThread);
std::unique_ptr<component::StartupContext> context(
@@ -55,10 +54,9 @@
// Serve the repository.
context->outgoing().AddPublicService<fuchsia::ledger::Ledger>(
[&repository](fidl::InterfaceRequest<fuchsia::ledger::Ledger> request) {
- zx_status_t status = repository->GetLedger(
+ repository->GetLedger(
convert::ExtendedStringView(kLedgerName).ToArray(),
std::move(request));
- exit(status == ZX_OK ? EXIT_SUCCESS : EXIT_FAILURE);
});
loop.Run();
return EXIT_SUCCESS;