Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330353 - The performance test JavaMoveLineTest#test() and subsequent tests fails on Linux machine.
Summary: The performance test JavaMoveLineTest#test() and subsequent tests fails on Li...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 09:18 EST by Satyam Kandula CLA
Modified: 2011-03-07 06:05 EST (History)
1 user (show)

See Also:


Attachments
proposed fix (1.29 KB, patch)
2011-02-14 04:54 EST, Deepak Azad CLA
no flags Details | Diff
final fix (2.04 KB, patch)
2011-02-14 07:36 EST, Deepak Azad CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Satyam Kandula CLA 2010-11-16 09:18:08 EST
Performance test JavaMoveLineTest#test() of EventDrivenTestSuite failed  with N20101113-2000 on one of the linux machine. The subsequent tests JavaReplaceAllTests#test() and JavaReplaceAllWithQuickDiffTest#test() of the same test suite also failed. 
JavaReplaceAllTests#test() and JavaReplaceAllWithQuickDiffTest#test() failed on N20101111-2000 but JavaMoveLineTest#test() passed. 

Exception logged with JavaMoveLineTest#test()
#################
Caused by: org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.jface.text.Position.<init>(Position.java:63)
at org.eclipse.jface.text.AbstractDocument.getPositions(AbstractDocument.java:1750)
at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getPositions(SynchronizableDocument.java:277)
at org.eclipse.jface.text.source.AnnotationModel.getRegionAnnotationIterator(AnnotationModel.java:737)
at org.eclipse.jface.text.source.AnnotationModel.getAnnotationIterator(AnnotationModel.java:699)
at org.eclipse.jface.text.source.AnnotationRulerColumn.doPaint1(AnnotationRulerColumn.java:727)
at org.eclipse.jface.text.source.AnnotationRulerColumn.doubleBufferPaint(AnnotationRulerColumn.java:541)
at org.eclipse.jface.text.source.AnnotationRulerColumn.redraw(AnnotationRulerColumn.java:824)
at org.eclipse.jface.text.source.AnnotationRulerColumn$6.run(AnnotationRulerColumn.java:807)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
#################

Exception logged for JavaReplace*#test()
#################
junit.framework.AssertionFailedError: null
at org.eclipse.jdt.text.tests.performance.AbstractJavaReplaceAllTest.measure(AbstractJavaReplaceAllTest.java:115)
at org.eclipse.jdt.text.tests.performance.AbstractJavaReplaceAllTest.test(AbstractJavaReplaceAllTest.java:71)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:377)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:210)
at org.eclipse.test.UITestApplication$2.run(UITestApplication.java:197)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3514)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3163)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:140)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:62)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:212)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
at org.eclipse.core.launcher.Main.main(Main.java:34)
################
Comment 1 Dani Megert CLA 2010-11-16 10:12:12 EST
Deepak, please take a look at this during our test pass when you're at the Linux machine.
Comment 2 Dani Megert CLA 2010-11-17 03:23:56 EST
Looks good again in latest I-build.
Comment 3 Satyam Kandula CLA 2010-11-23 06:16:40 EST
This failed again in N20101118-2000 build with the following call stack .. Reopening! 
#########
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.jface.text.Position.<init>(Position.java:63)
at org.eclipse.jface.text.AbstractDocument.getPositions(AbstractDocument.java:1750)
at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getPositions(SynchronizableDocument.java:277)
at org.eclipse.jface.text.source.AnnotationModel.getRegionAnnotationIterator(AnnotationModel.java:737)
at org.eclipse.jface.text.source.AnnotationModel.getAnnotationIterator(AnnotationModel.java:699)
at org.eclipse.jface.text.source.AnnotationRulerColumn.doPaint1(AnnotationRulerColumn.java:727)
at org.eclipse.jface.text.source.AnnotationRulerColumn.doubleBufferPaint(AnnotationRulerColumn.java:541)
at org.eclipse.jface.text.source.AnnotationRulerColumn.redraw(AnnotationRulerColumn.java:824)
at org.eclipse.jface.text.source.AnnotationRulerColumn$InternalListener.viewportChanged(AnnotationRulerColumn.java:79)
at org.eclipse.jface.text.TextViewer.updateViewportListeners(TextViewer.java:3112)
at org.eclipse.jface.text.TextViewer$ViewportGuard.keyReleased(TextViewer.java:299)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:168)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294)
at org.eclipse.swt.widgets.Widget.gtk_key_release_event(Widget.java:736)
at org.eclipse.swt.widgets.Control.gtk_key_release_event(Control.java:2854)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1744)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4800)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4359)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8253)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1239)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2255)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3158)
at org.eclipse.jdt.text.tests.performance.EditorTestHelper.runEventQueue(EditorTestHelper.java:196)
at org.eclipse.jdt.text.tests.performance.EditorTestHelper.runEventQueue(EditorTestHelper.java:192)
at org.eclipse.jdt.text.tests.performance.EditorTestHelper.runEventQueue(EditorTestHelper.java:184)
at org.eclipse.jdt.text.tests.performance.MoveLineTest.measureMoveLine(MoveLineTest.java:95)
at org.eclipse.jdt.text.tests.performance.MoveLineTest.test(MoveLineTest.java:65)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:377)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:210)
at org.eclipse.test.UITestApplication$2.run(UITestApplication.java:197)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3514)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3163)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:140)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:62)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:212)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
at org.eclipse.core.launcher.Main.main(Main.java:34)
##############
Comment 4 Dani Megert CLA 2010-11-23 06:38:25 EST
:-(
Comment 5 Deepak Azad CLA 2010-12-08 08:30:14 EST
There are four tests in question here
- TextMoveLineTest
- JavaMoveLineTest
- JavaReplaceAllTest
- JavaReplaceAllWithQuickDiffTest

I was looking at the performance data with Satyam, and found that all these tests fail together quite often, but it is not so in all cases. For example, in some cases TextMoveLineTest passes but JavaMoveLineTest passes. In some cases one of JavaReplace* passes but JavaMoveLineTest fails.

Plus the failures are intermittent, and quite difficult to reproduce.
Comment 6 Deepak Azad CLA 2011-02-07 10:02:16 EST
(In reply to comment #5)
> There are four tests in question here
> - TextMoveLineTest
> - JavaMoveLineTest
> - JavaReplaceAllTest
> - JavaReplaceAllWithQuickDiffTest
Filed bug 336514 for for JavaReplaceAllTest. This bug will deal with *MoveLineTests.
Comment 7 Deepak Azad CLA 2011-02-10 04:18:04 EST
(In reply to comment #6)
> Filed bug 336514 for for JavaReplaceAllTest. This bug will deal with
> *MoveLineTests.

I think both these bugs are caused by Bug 323044.
Comment 8 Deepak Azad CLA 2011-02-14 04:54:08 EST
Created attachment 188881 [details]
proposed fix
Comment 9 Deepak Azad CLA 2011-02-14 04:57:23 EST
Calling EditorTestHelper.runEventQueue() multiple times seems to be executing the same event multiple times on Linux (a bug ?). If I just call it just once, the test seems to be working, at least it does not fail on my Linux machine anymore.

I have tested this fix on WinXP as well.
Comment 10 Deepak Azad CLA 2011-02-14 04:58:07 EST
Dani, ok to release this fix in HEAD ?
Comment 11 Dani Megert CLA 2011-02-14 04:59:11 EST
(In reply to comment #9)
> Calling EditorTestHelper.runEventQueue() multiple times seems to be executing
> the same event multiple times on Linux (a bug ?).
"seems" or "does"? If "does" then it's a bug. You should be able to check that using a display filter.
Comment 12 Deepak Azad CLA 2011-02-14 05:32:38 EST
(In reply to comment #11)
> (In reply to comment #9)
> > Calling EditorTestHelper.runEventQueue() multiple times seems to be executing
> > the same event multiple times on Linux (a bug ?).
> "seems" or "does"? If "does" then it's a bug. You should be able to check that
> using a display filter.

The display filter gets the same number of key events that we generate from our code. It could be an OS issue...
Comment 13 Dani Megert CLA 2011-02-14 06:05:16 EST
(In reply to comment #10)
> Dani, ok to release this fix in HEAD ?
First
- Verify that the changes don't affect the performance (if it does, we need to
  backport the fix.
- Update the copyright date.
- Get rid of remaining (old) warnings in that file.
If that's done you can commit to HEAD.
Comment 14 Deepak Azad CLA 2011-02-14 07:36:11 EST
Created attachment 188894 [details]
final fix

Fixed in HEAD.

Performance numbers are not affected.

*Without patch*
Scenario 'org.eclipse.jdt.text.tests.performance.JavaMoveLineTest#test()' (average over 5 samples):
  Used Java Heap:        -9.65M         (95% in [-33.69M, 14.4M])      Measurable effect: 34.64M (1.8 SDs) (required sample size for an effect of 5% of stdev: 6401)
  Working Set:           -1.25M         (95% in [-2.68M, 174.51K])     Measurable effect: 2.05M (1.8 SDs) (required sample size for an effect of 5% of mean: 5356)
  Committed:             -1.29M         (95% in [-2.63M, 44.48K])      Measurable effect: 1.93M (1.8 SDs) (required sample size for an effect of 5% of mean: 4435)
  Working Set Peak:          0          (95% in [0, 0])               
  Elapsed Process:        2.01s         (95% in [1.95s, 2.08s])        Measurable effect: 91ms (1.8 SDs)
  Kernel time:            1.04s         (95% in [929ms, 1.15s])        Measurable effect: 159ms (1.8 SDs) (required sample size for an effect of 5% of mean: 47)
  Page Faults:             440          (95% in [-64, 945])            Measurable effect: 727 (1.8 SDs) (required sample size for an effect of 5% of mean: 5458)
  CPU Time:               2.14s         (95% in [1.84s, 2.43s])        Measurable effect: 420ms (1.8 SDs) (required sample size for an effect of 5% of mean: 78)
  GDI Objects:               0          (95% in [0, 0])               

*With patch*
Scenario 'org.eclipse.jdt.text.tests.performance.JavaMoveLineTest#test()' (average over 5 samples):
  Used Java Heap:       -13.68M         (95% in [-15.82M, -11.54M])    Measurable effect: 3.08M (1.8 SDs) (required sample size for an effect of 5% of mean: 102)
  Working Set:            1.43M         (95% in [-2.97M, 5.84M])       Measurable effect: 6.34M (1.8 SDs) (required sample size for an effect of 5% of stdev: 6401)
  Committed:              1.46M         (95% in [-3.11M, 6.03M])       Measurable effect: 6.58M (1.8 SDs) (required sample size for an effect of 5% of stdev: 6401)
  Working Set Peak:          0          (95% in [0, 0])               
  Elapsed Process:         1.9s         (95% in [1.83s, 1.97s])        Measurable effect: 96ms (1.8 SDs) (required sample size for an effect of 5% of mean: 6)
  Kernel time:             990ms        (95% in [849ms, 1.13s])        Measurable effect: 203ms (1.8 SDs) (required sample size for an effect of 5% of mean: 85)
  Page Faults:             1.2K         (95% in [-419, 2.82K])         Measurable effect: 2.33K (1.8 SDs) (required sample size for an effect of 5% of stdev: 6401)
  CPU Time:               2.15s         (95% in [1.81s, 2.49s])        Measurable effect: 494ms (1.8 SDs) (required sample size for an effect of 5% of mean: 106)
  GDI Objects:               0          (95% in [0, 0])
Comment 15 Deepak Azad CLA 2011-02-16 08:42:12 EST
The test completed successfully on the latest I-Build
http://download.eclipse.org/eclipse/downloads/drops/I20110215-0800/performance/eplnx2/Scenario114.html
Comment 16 Satyam Kandula CLA 2011-03-02 04:21:29 EST
Deepak, 
Can you please release the fix on the baseline branch too? There is a huge regression on Linux.
Comment 17 Dani Megert CLA 2011-03-02 04:23:49 EST
(In reply to comment #16)
> Deepak, 
> Can you please release the fix on the baseline branch too? There is a huge
> regression on Linux.

This contradicts to comment 14: "Performance numbers are not affected."

Details please.
Comment 18 Satyam Kandula CLA 2011-03-02 04:30:03 EST
(In reply to comment #17)
> This contradicts to comment 14: "Performance numbers are not affected."
> 
> Details please.
I think the numbers were taken on windows machine and there is no regression there. On Linux, the baseline shows 73ms and the 3.7 shows 975ms.
Comment 19 Deepak Azad CLA 2011-03-02 04:36:06 EST
There is no regression in the sense that the performance has NOT degraded, as can be seen on Windows. 

However the baseline for Linux isn't perfect, because the test was also not perfect. However the numbers on Linux after the fix are consistent and similar to the numbers on other platforms.
Comment 20 Dani Megert CLA 2011-03-02 04:38:35 EST
(In reply to comment #19)
> There is no regression in the sense that the performance has NOT degraded, as
> can be seen on Windows. 
> 
> However the baseline for Linux isn't perfect, because the test was also not
> perfect. However the numbers on Linux after the fix are consistent and similar
> to the numbers on other platforms.

Sounds good then. Please backport to 'perf_36x' and release it into the 'org.eclipse.releng' project from the same branch.
Comment 21 Deepak Azad CLA 2011-03-07 06:04:46 EST
Fix backported to 'perf_36x' and released.
Comment 22 Deepak Azad CLA 2011-03-07 06:05:44 EST
.