[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-930) Follow up Jenkins feedback on Hibernate Search build on Windows

Hardy Ferentschik (JIRA) noreply at atlassian.com
Thu Sep 29 03:38:32 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43834#comment-43834 ] 

Hardy Ferentschik commented on HSEARCH-930:
-------------------------------------------

{noformat}
Stacktrace

org.hibernate.HibernateException: Unable to setup test directories
	at org.hibernate.search.test.directoryProvider.FSSlaveAndMasterDPTest.prepareDirectories(FSSlaveAndMasterDPTest.java:190)
	at org.hibernate.search.test.directoryProvider.RetryInitializeTest.setUp(RetryInitializeTest.java:57)
	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:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
	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:597)
	at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
	at $Proxy0.invoke(Unknown Source)
	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

Standard Output

02:44:49,056 (main) ERROR FileHelper:205 - HSEARCH000032: Could not delete .\lucenedirs\master\main\org.hibernate.search.test.directoryProvider.SnowStorm\_0.fdt
{noformat}

Also on Linux/Mac _FSSlaveAndMasterDPTest_ causes a lucene directory being created in the module directory instead of the target sub-directory.
This is caused by
{code}
	static {
		String buildDir = System.getProperty( "build.dir" );
		if ( buildDir == null ) {
			buildDir = ".";
		}
		root = new File( buildDir, "lucenedirs" );
		log.debugf( "Using %s as test directory.", root.getAbsolutePath() );
	}
{code}
which expects a _build.dir_ property. I think we used to do it this way, but the better approach can be seen in _SearchTestCase_
{code}
	static {
		ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
		// get a URL reference to something we now is part of the classpath (us)
		URL myUrl = contextClassLoader.getResource( SearchTestCase.class.getName().replace( '.', '/' ) + ".class" );
		File myPath = new File( myUrl.getFile() );
		// navigate back to '/target'
		targetDir = myPath
				.getParentFile()  // target/classes/org/hibernate/search/test
				.getParentFile()  // target/classes/org/hibernate/search
				.getParentFile()  // target/classes/org/hibernate/
				.getParentFile()  // target/classes/org
				.getParentFile()  // target/classes/
				.getParentFile(); // target

		indexDir = new File( targetDir, "indextemp" );
		log.debugf( "Using %s as index directory.", indexDir.getAbsolutePath() );
	}
{code}
This approach does not rely on a system property. Not sure whether this is causing the actual errors on windows, but it should be addressed nevertheless.

> Follow up Jenkins feedback on Hibernate Search build on Windows
> ---------------------------------------------------------------
>
>                 Key: HSEARCH-930
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-930
>             Project: Hibernate Search
>          Issue Type: Task
>    Affects Versions: 4.0.0.Beta2
>            Reporter: Emmanuel Bernard
>             Fix For: 4.0.0.CR1
>
>
> Build on Windows are not stable but for weird reasons.
> http://hudson.qa.jboss.com/hudson/job/hibernate-search-master-windows/

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list