Bug 428069 - DebugEvaluationTest.test012
Summary: DebugEvaluationTest.test012
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: test
Depends on:
Blocks:
 
Reported: 2014-02-13 03:34 EST by Dani Megert CLA
Modified: 2020-03-08 17:04 EDT (History)
4 users (show)

See Also:


Attachments
Proposed fix (5.46 KB, patch)
2014-08-28 07:20 EDT, Jay Arthanareeswaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2014-02-13 03:34:58 EST
N20140212-2000.

http://download.eclipse.org/eclipse/downloads/drops4/N20140212-2000/testresults/html/org.eclipse.jdt.core.tests.compiler_linux.gtk.x86_6.0.html

Value expected:<true> but was:<false>

junit.framework.AssertionFailedError: Value expected:<true> but was:<false>
at org.eclipse.jdt.core.tests.eval.EvaluationTest.failNotEquals(EvaluationTest.java:471)
at org.eclipse.jdt.core.tests.eval.EvaluationTest.assertEquals(EvaluationTest.java:156)
at org.eclipse.jdt.core.tests.eval.DebugEvaluationTest.test012(DebugEvaluationTest.java:581)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:55)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:657)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:133)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:228)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Stephan Herrmann CLA 2014-02-13 09:05:29 EST
S.t. non-deterministic going on here, I sometimes observe this when running the tests in the IDE, too.
Comment 2 Dani Megert CLA 2014-04-04 04:35:46 EDT
DebugEvaluationTest.test048 (test048 - 1.5) failed in N20140403-2000:

N/A

org.eclipse.jdt.internal.eval.InstallException
at org.eclipse.jdt.internal.eval.EvaluationContext.evaluate(EvaluationContext.java:298)
at org.eclipse.jdt.core.tests.eval.DebugEvaluationTest.evaluate(DebugEvaluationTest.java:148)
at org.eclipse.jdt.core.tests.eval.DebugEvaluationTest.test048(DebugEvaluationTest.java:2048)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:55)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:657)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 3 Dani Megert CLA 2014-05-12 04:35:09 EDT
This one failed again. This time on Windows:

test012 - 1.6

Value expected:<true> but was:<false>

junit.framework.AssertionFailedError: Value expected:<true> but was:<false>
at org.eclipse.jdt.core.tests.eval.EvaluationTest.failNotEquals(EvaluationTest.java:471)
at org.eclipse.jdt.core.tests.eval.EvaluationTest.assertEquals(EvaluationTest.java:156)
at org.eclipse.jdt.core.tests.eval.DebugEvaluationTest.test012(DebugEvaluationTest.java:584)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:55)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:657)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 4 shankha banerjee CLA 2014-07-30 05:43:17 EDT
Failed again.

N20140729-2000

http://download.eclipse.org/eclipse/downloads/drops4/N20140729-2000/testresults/html/org.eclipse.jdt.core.tests.compiler_linux.gtk.x86_64_8.0.html

test012 - 1.3	


Failure	Value expected:<true> but was:<false> 

Call stack same as Comment 3.

Thanks
Comment 5 shankha banerjee CLA 2014-08-11 05:13:48 EDT
Failed Again.

Build ID: N20140810-2000

http://download.eclipse.org/eclipse/downloads/drops4/N20140810-2000/testResults.php

test012 - 1.7

Value expected:<true> but was:<false>.
Comment 6 shankha banerjee CLA 2014-08-12 22:04:45 EDT
Failed again.
Build ID: I20140812-0800
test012 - 1.3
Comment 7 Jay Arthanareeswaran CLA 2014-08-13 10:00:50 EDT
The failure has occurred both on Linux (more than once) and Windows and across multiple JRE levels. Just looking at the order of tests run, I don't think it could be inter dependencies between tests (not sure, though).
Comment 8 Jay Arthanareeswaran CLA 2014-08-14 02:44:42 EDT
One theory is that the preceding assignment of variable 'date' never takes effect or the second evaluation is kicked off even before the previous result has been stored. 

Interestingly, the next test in line test013, which is commented out, is identical to the one failing now - only difference being reassignment of an int variable being tested instead of java.util.Date.
Comment 9 Jay Arthanareeswaran CLA 2014-08-14 05:21:11 EDT
I have put some trouble shooting log here:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=7bcf1741dcb918f3307ee7d52f0450e52fdd3029

However, if my theory (comment #8) is correct and the trouble shooting code introduces some delay, they tests may not fail. Anyway, let's wait and see what the results produce.
Comment 11 Jay Arthanareeswaran CLA 2014-08-28 07:20:01 EDT
Created attachment 246481 [details]
Proposed fix

I suspect the previous evaluation doesn't quite complete before the next one picks up the stale value in test012(). I can't reproduce this behavior, but...

In org.eclipse.jdt.core.eval.IEvaluationContext.evaluateCodeSnippet(), I see the following documentation:

* This method is long-running; progress and cancellation are provide
* by the given progress monitor.

Unfortunately the implementing EvaluationContext and EvaluationContextWrapper (and as a result our tests) don't make use of the progress monitor. I will release some more trouble shooting logs (in place of the ones I already put, which isn't quite useful) before confirming my thoughts and releasing this fix. But at the moment, I strongly believe this is a test only issue.
Comment 12 Srikanth Sankaran CLA 2014-09-01 02:21:34 EDT
I notice that this test --> test012 has started hanging of late - particularly
when run as RunAll* - You can reproduce easily by launching RunAllJava8Tests.

Jay, could you just glance through the logging code added recently to make
sure that is causing the shift in symptoms ? TIA.
Comment 13 shankha banerjee CLA 2014-09-01 05:19:38 EDT
Failed again.
Build ID: N20140831-2000
Platform: Linux
test012 - 1.5
Comment 14 Jay Arthanareeswaran CLA 2014-09-02 01:57:59 EDT
(In reply to shankha banerjee from comment #13)
> Failed again.
> Build ID: N20140831-2000
> Platform: Linux
> test012 - 1.5

From the logs:

Old date =	Thu Oct 04 19:00:00 EST 1582
new date =	Mon Sep 01 03:57:54 EDT 2014
cal.getGregorianChange() =	Thu Oct 04 19:00:00 EST 1582
...
Old date =	Thu Oct 04 19:00:00 EST 1582
new date =	Thu Oct 04 19:00:00 EST 1582

The first set of print outs are from a passing instance and the second is from the failing tests. So, looks like the assignment of the date never took place or completed. This confirms my thoughts that it is indeed a timing issue.

After looking at the complaint from comment #12, I will release the fix for the test.
Comment 15 Jay Arthanareeswaran CLA 2014-09-02 02:02:35 EDT
(In reply to Srikanth Sankaran from comment #12)
> I notice that this test --> test012 has started hanging of late -
> particularly
> when run as RunAll* - You can reproduce easily by launching RunAllJava8Tests.
> 
> Jay, could you just glance through the logging code added recently to make
> sure that is causing the shift in symptoms ? TIA.

I don't see the test hanging. Do you see the tests taking longer time or they actually hang? The changes to the tests only included some print statements to the snippet being evaluated.
Comment 16 Srikanth Sankaran CLA 2014-09-02 02:32:11 EDT
I have seen my test runs being stuck at this test for 5 minutes or more. I didn't
verify if the test is really hanging - so I am using "hang" somewhat informally.
Comment 17 Srikanth Sankaran CLA 2014-09-03 02:48:09 EDT
I have disabled this test as it consistently appears to hang when you run
RunAllJava8Tests.
Comment 18 Jay Arthanareeswaran CLA 2014-09-03 02:59:27 EDT
(In reply to Srikanth Sankaran from comment #17)
> I have disabled this test as it consistently appears to hang when you run
> RunAllJava8Tests.

Srikanth, it will be good if you can find some time to see what's going on in your machine. Perhaps you can take the thread dump when it happens and share it so we can investigate? I don't see this in my environment and nor in the build environment. In the build environment, this particular test doesn't take more than a sec (regardless pass/fail). TIA!
Comment 19 shankha banerjee CLA 2014-09-03 03:03:58 EDT
I(In reply to Jayaprakash Arthanareeswaran from comment #18)
> Srikanth, it will be good if you can find some time to see what's going on
> in your machine. Perhaps you can take the thread dump when it happens and
> share it so we can investigate? I don't see this in my environment and nor
> in the build environment. In the build environment, this particular test
> doesn't take more than a sec (regardless pass/fail). TIA!

I can see the hang issue sometimes while running RunAllJava8Tests.
I will investigate and let you know.

Thanks
Comment 20 shankha banerjee CLA 2014-09-10 10:22:58 EDT
This is what I observe:

While performing the write operation : 
185: out.write(classDefinition); // [1]
we get a NPE. There is no call stack. 

The unit test case does not proceed beyond the line:
EventSet set = this.jdiVM.eventQueue().remove(); // [2]

The scenario is not 100% reproducible. I observe this behavior while we run
RunAllJava8 tests.

---
[1] Stack Trace
Thread [main] (Suspended)	
	TargetInterface.sendClasses(boolean, ClassFile[]) line: 185	
	EvaluationTest$Requestor.acceptClassFiles(ClassFile[], char[]) line: 52	
	EvaluationContext.evaluate(char[], char[][], char[][], int[], char[], boolean, boolean, INameEnvironment, Map, IRequestor, IProblemFactory) line: 297	
	EvaluationContext.evaluate(char[], INameEnvironment, Map, IRequestor, IProblemFactory) line: 316	
	JDIStackFrame.getDebuggedThread(DebugEvaluationTest) line: 153	
	JDIStackFrame.<init>(VirtualMachine, DebugEvaluationTest, String, String, String, int, long) line: 86	
	JDIStackFrame.<init>(VirtualMachine, DebugEvaluationTest, String, String, String, int) line: 66	
	JDIStackFrame.<init>(VirtualMachine, DebugEvaluationTest, String) line: 56	
	DebugEvaluationTest.test012() line: 569	

---

[2] Stack Trace
Thread [main] (Suspended)	
	JDIStackFrame.getDebuggedThread(DebugEvaluationTest) line: 180	
	JDIStackFrame.<init>(VirtualMachine, DebugEvaluationTest, String, String, String, int, long) line: 86	
	JDIStackFrame.<init>(VirtualMachine, DebugEvaluationTest, String, String, String, int) line: 66	
	JDIStackFrame.<init>(VirtualMachine, DebugEvaluationTest, String) line: 56	
	DebugEvaluationTest.test012() line: 569
Comment 21 Eclipse Genie CLA 2020-03-08 17:04:23 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.