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

Bug 380420

Summary: Build failures on Eclipse Hudson with delete files from /tmp
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RelengAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: ivan: review+
Version: 1.5   
Target Milestone: 1.5 RC2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ralf Sternberg CLA 2012-05-23 10:39:52 EDT
All of a sudden, we got a number of test failures in our Hudson jobs rap-1.5-runtime and rap-2.0-runtime. These failures does not occur consistently, but they have happened a couple of times in a row now.

The reason is always a failure to delete files from /tmp/testapp.

java.lang.IllegalStateException: Could not delete: /tmp/testapp/rwt-resources
	at org.eclipse.rwt.internal.application.ApplicationContextUtil.deleteFile(ApplicationContextUtil.java:136)
	at org.eclipse.rwt.internal.application.ApplicationContextUtil.doDelete(ApplicationContextUtil.java:122)
	at org.eclipse.rwt.internal.application.ApplicationContextUtil.delete(ApplicationContextUtil.java:97)
	at org.eclipse.rwt.internal.application.ApplicationContext.doDeactivateInstances(ApplicationContext.java:315)
	at org.eclipse.rwt.internal.application.ApplicationContext.access$1(ApplicationContext.java:300)
	at org.eclipse.rwt.internal.application.ApplicationContext$2.run(ApplicationContext.java:295)
	at org.eclipse.rwt.internal.application.ApplicationContextUtil.runWith(ApplicationContextUtil.java:89)
	at org.eclipse.rwt.internal.application.ApplicationContext.deactivateInstances(ApplicationContext.java:293)
	at org.eclipse.rwt.internal.application.ApplicationContext.doDeactivate(ApplicationContext.java:288)
	at org.eclipse.rwt.internal.application.ApplicationContext.deactivate(ApplicationContext.java:139)
	at org.eclipse.rwt.application.ApplicationRunner.stop(ApplicationRunner.java:93)
	at org.eclipse.rwt.engine.RWTServletContextListener.contextDestroyed(RWTServletContextListener.java:52)
	at org.eclipse.rap.rwt.testfixture.Fixture.triggerServletContextDestroyed(Fixture.java:140)
	at org.eclipse.rap.rwt.testfixture.Fixture.disposeOfApplicationContext(Fixture.java:156)
	at org.eclipse.rap.rwt.testfixture.Fixture.tearDown(Fixture.java:238)
	at org.eclipse.rwt.internal.lifecycle.LifeCycleUtil_Test.tearDown(LifeCycleUtil_Test.java:33)
Comment 1 Ralf Sternberg CLA 2012-05-23 11:56:45 EDT
I guess I know what's going on: now that we have two runtime builds (1.5 and 2.0) started at the same time and thus running in parallel, they accessing the same temp directory. One build is deleting the other build's resources!

As a workaround, I've scheduled the 1.5 builds to run one hour later than the 2.0 builds. We should, however, make the test fixture more stable. /tmp/testapp doesn't seem to be specific enough for a build server where all Eclipse projects are built.
Comment 2 Ralf Sternberg CLA 2012-05-23 16:00:29 EDT
Fixed with commit bbb9c01db2a57940aeab89e84a1a763e67c4400e. The solution is to create a separate unique temp directory for every run of the test suite.

The directly is created on class loading time of the Fixture. This may not be ideal, but was the simplest possible change. We may consider to replace the TEMP_DIR constant with a getTempDir() method in order to delay the creation of the temp dir until it is actually needed.

I'd suggest to pickup the change in the 1.5 stream to avoid those test failures in the future.
Comment 3 Ivan Furnadjiev CLA 2012-05-24 03:27:49 EDT
(In reply to comment #2)
> I'd suggest to pickup the change in the 1.5 stream to avoid those test failures
> in the future.
+1 Looks good for me.
Comment 4 Ralf Sternberg CLA 2012-05-24 04:53:40 EDT
Fixed in 1.5 by commit f01c29145c2bbd0ba324deec102e814f9f56758b