wakaba/perl-rdb-utils — pull request #1 by tarao (2013-06-27 10:42:33+00:00)
Title: Ensure cleaning up the temporary directory for mysqld

## Issue

The temporary directory for mysqld (something like ``/tmp/78Idw54D38``) remains after running a test at least on my environment, perl-5.18.0 x86_64-linux. As far as I investigated, the worker process of mysqld is killed before the cleanups for that process. (I guess this is done by the ``END`` in ``AnyEvent::Worker`` [line 370](https://github.com/Mons/AnyEvent-Worker/blob/master/lib/AnyEvent/Worker.pm#L370) .)

## Way to fix

One way to fix the issue is to give some time to the worker to clean up. You can confirm this by inserting for example ``sleep(3)`` before [Test::AnyEvent::Servers line 165](https://github.com/wakaba/perl-test-anyevent-servers/blob/master/lib/Test/AnyEvent/Servers.pm#L165). What we should do is to wait the worker process to finish the cleanups at ``Test::AnyEvent::MySQL::Server#stop_as_cv`` but I couldn't get it work together with ``Test::X1`` without causing ``Possible memory leak detected ... during global destruction``.

The patch in this pull request is a compromise, which makes ``Test::AnyEvent::MySQL::Server`` take care of cleaning up the temporary directory. You would better reject this pull request if you have any good solution.