Skip to content

Commit c28b57b

Browse files
author
Praveen Innamuri
committed
Resolving a deadlock with git test cases.
1 parent 9381d73 commit c28b57b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/com.aptana.git.core.tests/src/com/aptana/git/core/model/GitTestCase.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,19 @@ protected void assertCommit(GitIndex index, String commitMessage) throws Excepti
101101
GitRepository repo = getRepo();
102102
try
103103
{
104-
repo.waitForWrite();
104+
// Aquiring the write lock before commit might cause deadlock with a git refresh job that is already
105+
// triggered (due to resource changes). After the commit is done, it refreshes and that requires the write
106+
// lock.
107+
108+
// repo.waitForWrite();
105109
IStatus status = index.commit(commitMessage);
106110
assertTrue("Failed to commit: " + status.getMessage(), status.isOK());
107111
assertTrue("After a commit, the repository changed file listing should be empty but is not", index
108112
.changedFiles().isEmpty());
109113
}
110114
finally
111115
{
112-
repo.exitWriteProcess();
116+
// repo.exitWriteProcess();
113117
}
114118
}
115119

0 commit comments

Comments
 (0)