Bug 541124 - IndexDiffCacheTest unstable
Summary: IndexDiffCacheTest unstable
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 5.2   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-14 01:51 EST by Michael Keppler CLA
Modified: 2018-11-22 06:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Keppler CLA 2018-11-14 01:51:00 EST
I've seen IndexDiffCacheTest fail on the server and locally with different test cases. I have this hypothesis: That test class stores only the _last_ indexDiffData that the listener saw. But there is no guarantee that we get only 1 event. Instead there might be multiple events and we need to collect the indexDiffData for all of them (that means waitForListenerCalled() must continue listening after the first received data until there is no more data received for some time).

Example: org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheTest.testAddFileFromUntrackedFolder()
That one fails locally in line 127, because the _first_ event does not contain the expected added data. But a second event contains it.

Does that make sense to anyone (since I really have no idea of the underlying git mechanics for indexdiff)?
Comment 1 Thomas Wolf CLA 2018-11-14 05:23:47 EST
This test has not been unstable in the past. I suspect the changes from the parallel pull to be responsible for this. Possibly https://git.eclipse.org/r/#/c/131572/9/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java .
Comment 2 Michael Keppler CLA 2018-11-14 07:51:32 EST
So do you think this needs some fix in the main code or is the fix in the test code as desribed above reasonable? Cause I imagine I can rework the test to cope with multiple events, but I have no clue about the main code.
Comment 3 Thomas Wolf CLA 2018-11-22 06:19:18 EST
IndexDiffCacheEntryTest is not the only test case affected by this. I strongly suspect that other failures we see recently are also caused by this:

* TagActionTest.testChangeTagMessage
  https://ci.eclipse.org/egit/job/egit/4945/
* GitRepositoriesViewBranchHandlingTest.testCreateCheckoutDeleteLocalBranch
  https://ci.eclipse.org/egit/job/egit/4947/

And possibly more.