Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 455542 - Antui Performance test throw java.lang.IllegalMonitorStateException
Summary: Antui Performance test throw java.lang.IllegalMonitorStateException
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4.2   Edit
Assignee: David Williams CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 454921
  Show dependency tree
 
Reported: 2014-12-17 16:30 EST by David Williams CLA
Modified: 2015-02-06 03:49 EST (History)
3 users (show)

See Also:
daniel_megert: pmc_approved+


Attachments
XML file that can be imported into JUnit. (25.46 KB, text/xml)
2014-12-17 16:52 EST, David Williams CLA
no flags Details
Simple fix. Patch clarifies exactly what I mean. (1.28 KB, patch)
2014-12-18 12:06 EST, David Williams CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2014-12-17 16:30:56 EST
3 of them do, that is. 

testOpenAntEditor1
testOpenAntEditor2
testOpenAntEditorNoFolding

They do this in both streams, baseline, or "current". 

If they can not be fixed easily, I suggest they be commented out.
Comment 1 David Williams CLA 2014-12-17 16:52:38 EST
Created attachment 249503 [details]
XML file that can be imported into JUnit.

I've looked at the test cases, and the common problem is in super class, that has says: 

wait(2000); // NOTE: runnables posted from other threads, while the main thread waits here, are executed and measured only in the next
             // iteration

So, problem number one: the method it is in is
protected void measureOpenInEditor(IFile file)
and it is not synchronized, so it will never "own" the monitor.

Problem number two: I do not see anywhere in the class in question a "notifiy" counter part. So, even if made synchronized, I think it'd just always wait for 2 seconds, and then continue. Doubt if that's the intent. 

I wonder if this method was "copied" from elsewhere? And is basically incomplete?
Comment 2 David Williams CLA 2014-12-18 12:05:17 EST
I have found there are similar method in jdt.txt.performance.tests, but, different ... they have some mechanism to "runEventQueue" that might be to serve similar purpose? 

But, I've also found, on my local test machine, that adding "synchronized" to the method allows the test to run, and I presume still relatively valid results. 

One of them does provide to the "global finger print" graph, so assume they are important tests. 

Will attach patch for the synchronized solution.
Comment 3 David Williams CLA 2014-12-18 12:06:36 EST
Created attachment 249532 [details]
Simple fix. Patch clarifies exactly what I mean.
Comment 4 Sarika Sinha CLA 2014-12-19 04:37:20 EST
(In reply to David Williams from comment #3)
> Created attachment 249532 [details]
> Simple fix. Patch clarifies exactly what I mean.

Looks like we do need to Synchronize this method !!
Comment 5 Michael Rennie CLA 2015-02-03 10:49:51 EST
Pushed to master:

http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=eccd2fea8b3928a5989600740e26eccc71a8df49

Pushed to 4.4.2:



Bundle version update:
Comment 6 Michael Rennie CLA 2015-02-03 10:57:11 EST
(In reply to Michael Rennie from comment #5)
 
> Pushed to 4.4.2:
> 
> 
> 
> Bundle version update:

Nothing was pushed to 4.4.2, I just forgot to delete that part of the comment when I was changing the bug...
Comment 7 David Williams CLA 2015-02-03 10:59:20 EST
I think we should fix this for RC3, so we have at least some measurement of this test case at at the end of 4.2.2 ... more to "compare to" in future.
Comment 9 David Williams CLA 2015-02-06 03:46:30 EST
(In reply to Dani Megert from comment #8)
> (In reply to Michael Rennie from comment #5)
> > Pushed to master:
> > 
> > http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=eccd2fea8b3928a5989600740e26eccc71a8df49
> 
> Cherry-picked to R4_4_maintenance with
> http://git.eclipse.org/c/platform/eclipse.platform.git/commit/
> ?id=a81a8d738de1c329f29f4cc2a998b4a4a1f8dd25
> 
> I've also updated the bundle version with
> http://git.eclipse.org/c/platform/eclipse.platform.git/commit/
> ?id=fc87bb52d92ff5c904855b527bdcc48e1f9b4308

While there's still issues displaying some of the Ant results, from RC3 performance tests, You can see the one "fingerprint" line, and now all 7 of unit the tests "pass". 

http://download.eclipse.org/eclipse/downloads/drops4/M20150204-1700/performance/performance.php
Comment 10 David Williams CLA 2015-02-06 03:49:08 EST
And I wanted to apologize ... I think I could have committed this fix, long ago, and just some how got it in my head that ant was in it's own repo ... but, this part is in "eclipse.platform", which, I can commit to.