SIGN IN SIGN UP

crimson/test: stop the messenger-thrash config on every exit path

test_messenger_thrash put sharded_conf().stop() in the success
continuation, so an exception from the tests skipped it and left the
static sharded<ConfigProxy> holding live instances. its destructor then
asserts. a tester hit this when the run went OOM at --memory 256M:

  ERROR [shard 0:main] test - Test failed: got exception
    ceph::buffer::v15_2_0::bad_alloc (Bad allocation [buffer:1])
  /ceph/src/seastar/include/seastar/core/sharded.hh:573:
    seastar::sharded<Service>::~sharded()
    [with Service = crimson::common::ConfigProxy]:
    Assertion `_instances.empty()' failed.
  terminate called without an active exception

run the body in seastar::async and stop the config through
seastar::deferred_stop, as crimson/osd/main.cc already does. the guard
is constructed only after start() succeeds, and its destructor stops the
config on any exit path, so a failing test exits cleanly instead of
aborting.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
K
Kefu Chai committed
68ec2a1b3fc20074615aad422b3b5642651b4ee6
Parent: 1605266