Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] SWTBot tests

On Fri, Mar 22, 2013 at 4:44 PM, Laurent Goubet <laurent.goubet@xxxxxxx> wrote:
I've updated the patch to only contain the elimination of the file handle leaks I could see. I'm giving up on fixing the random failure corresponding to the "remote" configuration of test repositories.

The "suspicious" line I was talking about was to fix a random failure of org.eclipse.egit.ui.view.repositories.GitRepositoriesViewFetchAndPushTest. On windows, it *sometimes* fails right within the "beforeClass", when it tries to create its remote configuration. I tracked that down all the way to org.eclipse.jgit.storage.file.FileBasedConfig.save(). In that particular occurence, the base config is not updated by the call to save.

In short, if you do the following and add a breakpoint on the "System.out" line, it will sometimes be triggered (more likely when launching the full swtbot suite).

diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
index 5509fc6..5860cbe 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
@@ -213,6 +213,8 @@ public void save() throws IOException {
         }
         snapshot = lf.getCommitSnapshot();
         hash = hash(out);
+        if (text.length() != 0 && toText().length() == 0)
+            System.out.println("?");
         // notify the listeners
         fireConfigChangedEvent();
     }

Basically: we had some text (the full config file's content), we saved it... and afterwards we no longer have anything in the config *object*. The config *file* on disk is fine and contains the correct, saved content ... only the object seems to have been wiped out.

I tried several times but can't reproduce this on Mac.

--
Matthias 

Back to the top