# # # add_file "tests/t_pidfile.at" # content [a6d189aafd6e7d59921bb9b75ef64037b1f76461] # ============================================================ --- tests/t_pidfile.at a6d189aafd6e7d59921bb9b75ef64037b1f76461 +++ tests/t_pidfile.at a6d189aafd6e7d59921bb9b75ef64037b1f76461 @@ -0,0 +1,30 @@ +AT_SETUP([pid file cleanup]) +MTN_SETUP +NETSYNC_SETUP + +AT_XFAIL_IF(true) + +# This test currently fails because monotone does not clean up it's pid file. +# This happens because when the monotone server is terminated with a signal it +# calls its signal handler which then performs a siglongjmp(). The pid file +# is deleted in the destructor for a pid_file object, and because of the +# siglongjmp() the destructor is never called. +# +# Severaly possible solutions exist: +# - Clean up the pid file manually after handling the signal. +# - Have the signal handler set a flag (global var or singleton) that is +# checked periodically that triggers and exception if set instead of using +# siglongjmp() (my favorite). +# - Something I have not considered yet. +# +# -- Matthew Nicholson + +NETSYNC_SERVE_START + +AT_CHECK(test -f monotone_at.pid, [], [ignore], [ignore]) +AT_CHECK(kill `cat monotone_at.pid`, [], [ignore], [ignore]) +AT_CHECK(test -f monotone_at.pid, [1], [ignore], [ignore]) + +NETSYNC_SERVE_STOP + +AT_CLEANUP