public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Zander <zander@javalobby.org>
To: Mauve Discuss <mauve-discuss@sources.redhat.com>
Subject: Re: gnu/testlet/java/nio/channels/FileChannel/manyopen.java broken
Date: Fri, 08 Oct 2004 17:00:00 -0000	[thread overview]
Message-ID: <200410081900.29934.zander@javalobby.org> (raw)
In-Reply-To: <1097229925.1087.10.camel@localhost>

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 
tests..

> 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...
-- 
Thomas

  parent reply	other threads:[~2004-10-08 17:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08  6:35 Noa Resare
2004-10-08  6:47 ` Stephen Crawley
2004-10-08 10:05   ` Mark Wielaard
2004-10-08 11:07     ` Noa Resare
2004-10-08 17:00     ` Thomas Zander [this message]
2004-10-11  0:50     ` Stephen Crawley
2004-10-11  6:39 Jeroen Frijters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200410081900.29934.zander@javalobby.org \
    --to=zander@javalobby.org \
    --cc=mauve-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).