Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335106

Summary: Regression in Bugzilla_326518_Test.testIndexBranchMerge
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.coreAssignee: Pascal Lehmann <pascal.lehmann>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: martin.fluegge, pascal.lehmann
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 335432    
Bug Blocks:    
Attachments:
Description Flags
Updated patch (separation of timestamp generation & actual set)
none
testcase none

Description Eike Stepper CLA 2011-01-23 06:03:16 EST
-- Error Log from JUnit --
Class: org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_326518_Test
Method: testIndexBranchMerge
Actual: null
Expected: null
Stack Trace:
org.eclipse.emf.cdo.tests.config.impl.ConfigTestException: Error in Bugzilla_326518_Test.testIndexBranchMerge [Combined, MEMBranches, JVM, Legacy]
	at org.eclipse.emf.cdo.tests.config.impl.ConfigTest.runBare(ConfigTest.java:474)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at org.eclipse.net4j.util.tests.AbstractOMTest.run(AbstractOMTest.java:196)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at org.eclipse.emf.cdo.tests.config.impl.ConfigTestSuite$TestWrapper.runTest(ConfigTestSuite.java:126)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID5 not found
	at org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$1.processStaleReference(CDOStaleReferencePolicy.java:44)
	at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:659)
	at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:621)
	at org.eclipse.emf.internal.cdo.object.CDOLegacyWrapper.getValueFromRevision(CDOLegacyWrapper.java:602)
	at org.eclipse.emf.internal.cdo.object.CDOLegacyWrapper.revisionToInstanceFeature(CDOLegacyWrapper.java:487)
	at org.eclipse.emf.internal.cdo.object.CDOLegacyWrapper.revisionToInstance(CDOLegacyWrapper.java:410)
	at org.eclipse.emf.internal.cdo.object.CDOLegacyWrapper.cdoInternalPostLoad(CDOLegacyWrapper.java:284)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.applyChangeSetData(CDOTransactionImpl.java:568)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.merge(CDOTransactionImpl.java:461)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.merge(CDOTransactionImpl.java:399)
	at org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_326518_Test.testIndexBranchMerge(Bugzilla_326518_Test.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at org.eclipse.net4j.util.tests.AbstractOMTest.runBare(AbstractOMTest.java:150)
	at org.eclipse.emf.cdo.tests.config.impl.ConfigTest.runBare(ConfigTest.java:465)
	... 18 more
Comment 1 Eike Stepper CLA 2011-01-23 06:04:19 EST
Martin, please have a look occasionally. It may be caused by the new view synchronization, see bug 335080
Comment 2 Pascal Lehmann CLA 2011-01-25 03:16:20 EST
The testcase logic has been altered, the 'bad' path should be catching the exception, while the 'good' path is committing without exception (there are no conflicting changes made, so merge should work fine).
The ObjectNotFoundException was caused by an index problem which should be fixed with the patch of #326518. However, while debugging I noticed that the merge changeSets are not computed correctly anymore, that's why the commit of the merged data fails.
I'll look into it later.
Comment 3 Martin Fluegge CLA 2011-01-25 03:23:48 EST
Hi pascal,

do you mean that the problem is more CDO core specific and should be fixed there?

Maybe legacy simply call the wrong method in the wrong place.
Comment 4 Pascal Lehmann CLA 2011-01-25 03:35:41 EST
Hi Martin,

I don't think it's legacy related, the access to the 'deleted' object causes a problem during the merge for legacy while for native it does a bit later during the commit (which is caught).
The problem is the reference to a deleted object, which is caused by a faulty merge because of the wrong (target in this case) changeset.
Comment 5 Pascal Lehmann CLA 2011-01-25 03:36:03 EST
I took the bug from you :)
Comment 6 Martin Fluegge CLA 2011-01-25 03:45:11 EST
Cool, less work to do :)

But I'll stay on the cc list if there are any question about legacy ;)
Comment 7 Eike Stepper CLA 2011-01-25 06:22:06 EST
Thank you guys ;-)
Comment 8 Pascal Lehmann CLA 2011-01-26 02:43:24 EST
Created attachment 187612 [details]
Updated patch (separation of timestamp generation & actual set)

(In reply to comment #12)
> (In reply to comment #10)
> Updated? I only see a new test class i the patch.
It was never committed, but there are already 2 versions posted :)

> Which one? The one from Nov., 3rd? I can't even apply that one anymore ;-(
Yes, that one. Interesting as it applies without problems here. I attached an updated version :)
Comment 9 Pascal Lehmann CLA 2011-01-26 02:44:31 EST
argh, wrong bug
Comment 10 Pascal Lehmann CLA 2011-01-26 05:19:23 EST
Created attachment 187626 [details]
testcase

Restored original testcase logic
Comment 11 Pascal Lehmann CLA 2011-01-26 08:06:44 EST
Committed revision 6934:
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 12 Eike Stepper CLA 2011-06-23 03:38:29 EDT
Available in R20110608-1407