Subject: | Successful test run doesn't clean the tmp dir |
When running "make test" successfully, the operation leaves a bunch of
files in /tmp (or whatever other directory specified by File::Spec->tmpdir):
/tmp/cgisess_2001
/tmp/cgisess_21112ed3a306cf9074a9666a6da3dfaa
/tmp/cgisess_e2323d81ec9ba10e3025a82e2d7da27f
/tmp/cgisess_ea5baa3df715cb85b070bcb98bab0c7d
/tmp/cgisess_testname
This is usually no problem, but becomes one when several users are
running tests on CGI::Session on the same system. There are at least
three potential solutions to this problem:
1) Clean all test-related session files when the testing is done (i.e.
keep it tidy around yourself)
or
2) Don't use hard-coded filenames like "cgisess_testname" or
"cgisess_2001", but add a random element (e.g. process id?)
or
3) Don't use a shared temporary folder, but instead store
testing-related session files somewhere inside the distribution
directory itself. (e.g. t/tmp/cgisess_testname)
On a side note, when new() fails to create a session because of existing
files not being overwriteable, i doesn't throw an exception or warn
about something going horribly wrong. Maybe that's worth fixing too? :)