This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gnu/testlet/java/nio/channels/FileChannel/ broken

On Friday 08 October 2004 12:05, Mark Wielaard wrote:
> What I think should be tested is whether a program can open lots of
> files. And that the systems notices that stale file handle resources can
> be removed so that a program can keep opening files if needed. (As long
> as there are no large number of life file handles open at the same
> time.)

So; what you want tested if 
a) File has finalize method
b) that method actually closes the filehandle
c) the GC / Finalizer / GC (in that order) is called early enough and often 
enough to ensure not only we don't have a OutOfMem, but also that we don't 
get an out-of-filehandles problem.

IMO that should give you 3 seperate tests with very different things; your 
test (from the description, I did not read the test itself) seems to have 
taken the black-box-approuch which is most of the time wrong for unit 

> Since I have seen multiple systems get this wrong in various ways I want
> to have an explicit test for this situation. It might be that this test
> does not simulate a real world program correctly, so if there are
> alternatives I would like to hear them instead of just deleting the test
> since some systems fail it.

Isn't creating an 'any' object with a finalizer and doing the same things, 
but keeping a counter of how often finalize is called verses how many 
objects are present going to test this problem much much simpler?

Just a thought...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]