Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Investigate hang/timeout in JavaRefactoringIntegrationTest with latest #1310

Closed
cdietrich opened this issue Mar 28, 2022 · 12 comments
Closed

Comments

@cdietrich
Copy link
Member

03:21:49 Running org.eclipse.xtend.ide.tests.refactoring.JavaRefactoringIntegrationTest
09:04:28 Cancelling nested steps due to timeout
09:04:28 Sending interrupt signal to process

https://ci.eclipse.org/xtext/job/xtext-xtend/job/cd_testTycho30/55/console
https://ci.eclipse.org/xtext/job/xtext-xtend/job/master/2146/console

@cdietrich
Copy link
Member Author

somehow the logging for timeouts does not log any stacktraces :(

@cdietrich
Copy link
Member Author

Bildschirmfoto vom 2022-03-28 20-41-51
@szarnekow do you have any platform changes in mind that could cause this?

@cdietrich
Copy link
Member Author

org.eclipse.xtend.ide.tests.refactoring.JavaRefactoringIntegrationTest.testRenameJavaMethod()

@cdietrich
Copy link
Member Author

possible candidates
https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/70037

@cdietrich
Copy link
Member Author

RefactoringStatusEntry.<init>(int, String, RefactoringStatusContext) line: 87	
RefactoringStatus.addFatalError(String, RefactoringStatusContext) line: 551	
RenameVirtualMethodProcessor(RenameMethodProcessor).checkNewElementName(String) line: 231	
RenameVirtualMethodProcessor(RenameMethodProcessor).doCheckFinalConditions(IProgressMonitor, CheckConditionsContext) line: 346	
RenameVirtualMethodProcessor.doCheckFinalConditions(IProgressMonitor, CheckConditionsContext) line: 128	
RenameVirtualMethodProcessor(JavaRenameProcessor).checkFinalConditions(IProgressMonitor, CheckConditionsContext) line: 51	
RenameRefactoring(ProcessorBasedRefactoring).checkFinalConditions(IProgressMonitor) line: 226	
RenameRefactoring(Refactoring).checkAllConditions(IProgressMonitor) line: 165	
RefactoringExecutionHelper$Operation.run(IProgressMonitor) line: 84	
BatchOperation.executeOperation() line: 41	
BatchOperation(JavaModelOperation).run(IProgressMonitor) line: 740	
Workspace.run(ICoreRunnable, ISchedulingRule, int, IProgressMonitor) line: 2315	
Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 2340	
JavaCore.run(IWorkspaceRunnable, ISchedulingRule, IProgressMonitor) line: 5929	
WorkbenchRunnableAdapter.run(IProgressMonitor) line: 108	
ModalContext$ModalContextThread.run() line: 122	

@cdietrich
Copy link
Member Author

test does

createFile("JavaClass.java", "public class JavaClass { public void foo() {} }");
IMethod foo = findJavaType("JavaClass").getMethod("foo", new String[0]);
renameJavaElement(foo, "baz");

with

	protected void renameJavaElement(IMethod javaElement, String newName) throws CoreException, InterruptedException,
			InvocationTargetException {
		syncUtil.totalSync(false);
		RenameSupport renameSupport = RenameSupport.create(javaElement, newName, RenameSupport.UPDATE_REFERENCES);
		renameSupport.perform(workbench.getActiveWorkbenchWindow().getShell(), workbench.getActiveWorkbenchWindow());
		syncUtil.totalSync(false);
		assertTrue(compositeRefactoringProcessorAccess.isDisposed());
	}

@cdietrich
Copy link
Member Author

cdietrich commented Mar 28, 2022

RenameMethodProcessor.initialize
seems to set the method name to old method name

	protected void initialize(IMethod method) {
		assignMethod(method);
		if (!fInitialized) {
			if (method != null)
				setNewElementName(method.getElementName());
			fUpdateReferences= true;
			initializeWorkingCopyOwner();
		}
	}

@cdietrich
Copy link
Member Author

the initialize call seems to override the newelementname again
Bildschirmfoto vom 2022-03-28 21-12-31
Bildschirmfoto vom 2022-03-28 21-13-05

@cdietrich
Copy link
Member Author

cc @jjohnstn

@jjohnstn
Copy link

Looking into it.

@jjohnstn
Copy link

I believe I have found the issue. I was able to reproduce the problem. I have created a follow-on patch:

https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/192294

Please recheck when the patch has been merged into a new build

@cdietrich
Copy link
Member Author

with upstream fix, test is green again thx @jjohnstn

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants