[cvs] bogofilter/tests t.frame,1.24,1.25

Matthias Andree matthias.andree at gmx.de
Tue Jan 21 01:21:07 CET 2003


David Relson <relson at osagesoftware.com> writes:

> Slow down!  I changed it for a reason.  Today I experienced a variety of
> peculiar results.  I was running "make -s check" variously from my cvs
> and tst hierarchies.  I was running with BF_TESTDIR=/mnt/ramdrive and
> SUPPRESS_DELETE=NO because having a test fail without leaving any
> evidence is just a source of trouble.  I saw tests that would succeed
> sometimes and fail other times.  t.robx once generated a 0.16 value
> which is very, very wrong.  I guessed it was files getting left behind,
> so changed t.frame to ensure that the directories are empty at the start
> of the test.  It would be O.K. to make the emptying subject to
> SUPPRESS_DELETE=NO.

There's nothing wrong in killing the directory, but we cannot do that
before we know we're the ONLY process to use it. We must be sure no
other process is using it at the same time, and bumping mkdir into an
existing directory is the safe way to figure.

The rm -rf $TMPDIR ; mkdir $TMPDIR stuff is after the "while" loop -- at
that time, we know that we're the only user of $TMPDIR -- for the other
user, mkdir $TMPDIR would've failed. OTOH, rm -rf $TMPDIR/* is both
incomplete and dangerous. '*' might be a symlink...

There is a small window for collision, but if it strikes, the mkdir
after the rm -rf is going to fail, so it will be caught and not confuse
the test. Do you think we should fix this?

-- 
Matthias Andree




More information about the bogofilter-dev mailing list