git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [JGIT PATCH 0/4] RepositoryTestCase cleanups

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Nov 29, 2008, 12:01 UTC
Message-ID
<200811291301.12095.robin.rosenberg@dewire.com>
In-Reply-To
<20081127214916.GD23984@spearce.org>
torsdag 27 november 2008 22:49:16 skrev Shawn O. Pearce:
Show 9 quoted lines
> Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > Ok, so here is an attempt to improve the ability of the JGit's unit
> > tests to delete temporary repositories. This has probably been seen
> > by many, but Jonas Fonseca raised the issue.
> 
> Hmpph.  This takes 19 seconds to run the suite, where it used to be
> only 2 seconds on the same system.  The slower run isn't something
> I'm too happy about, actually I'd like to make the run even faster
> than 2 seconds.

So maybe we should clean up less. Every new test repo we create has a new name so we could do without cleaning up so much. The cleanup however is a verification that we close (and can close) our resources, though it only works on Windows :/ On unix we could spawn lsof but that is really really slow.

Show 6 quoted lines
> If the issue is mmap'd files, why don't we instead disable mmap
> on Windows during JUnit tests, and use the non-mmap variant of
> pack access?  At least do that for the bulk of the tests, and
> then have a single test case which tests the mmap code path but
> has careful System.gc calls in place to try and ensure we can
> actually clean up the temporary files.

We would then need some other really slow test to play rough with memory mapping and gc. As I mentioned above it is actually about closing resources in general, mmapped files being an especially nasty case.

Show 7 quoted lines
> I'd actually like to get that Repository refactoring done soon,
> someone else was asking about it for the RefDatabase (to store the
> refs in a SQL database so JGit ties into JTA) but I may also want
> it for Gerrit 2 - I'm looking at doing something that would put
> 200,000 refs per year into a repository.  That's so large that
> most operations can't afford to scan the entire ref database,
> and it really cannot be loose.  ;-)
Would be cool, but having that diff engine is more important to me.
Show 11 quoted lines
> 
> 
> Refactoring repository is a fair chunk of work, disabling the mmap
> feature under Windows in JUnit may be easier.  Hmm, according to
> WindowCache's <clinit> its default by false.  Why is it enabling
> on Windows?  The only code that calls WindowCache.reconfigure()
> is in the Eclipse plugin, so pure JGit unit tests shouldn't be
> turning on mmap code *at all*.
> 
> Which also points out a gap in our tests.  Nothing new, we have
> lots of gaps.  *sigh*
Yep.  :/
-- robin
Previous: Shawn O. PearceNext: Johannes Schindelin
Message 3 of 15 in “RepositoryTestCase cleanups”
  1. 0/4 RepositoryTestCase cleanupsRobin Rosenberg, Nov 27, 2008
  2. Shawn O. PearceNov 27, 2008
  3. Robin RosenbergNov 29, 2008
  4. Johannes SchindelinDec 1, 2008
  5. Robin RosenbergNov 30, 2008
  6. 0/8 Unit test cleanupsRobin Rosenberg, Nov 30, 2008
  7. 1/8 Drop unneeded code in unit testsRobin Rosenberg, Nov 30, 2008
  8. 2/8 Cleanup malformed test casesRobin Rosenberg, Nov 30, 2008
  9. 3/8 Turn off memory mapping in JGit unit tests by defaultRobin Rosenberg, Nov 30, 2008
  10. 4/8 Add a counter to make sure the test repo name is uniqueRobin Rosenberg, Nov 30, 2008
  11. 5/8 Make the cleanup less verbose when it fails to delete temporary stuff.Robin Rosenberg, Nov 30, 2008
  12. 6/8 Cleanup after each test.Robin Rosenberg, Nov 30, 2008
  13. 7/8 Close files opened by unit testing frameworkRobin Rosenberg, Nov 30, 2008
  14. 8/8 Hard failure on unit test cleanups if they fail.Robin Rosenberg, Nov 30, 2008
  15. Shawn O. PearceDec 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.