[wildfly-dev] Keep getting directory not exists errors in build

Aleksandar Kostadinov akostadi at redhat.com
Mon Jun 3 13:20:30 EDT 2013


agh, list() does not throw...

please put this instead of list() after the mkdir() call:
if (! newDir.isDirectory()) System.out.println("dir failed: " + 
newDir.getName());

Aleksandar Kostadinov wrote, On 06/03/2013 08:12 PM (EEST):
> We often need to test in non-ideal environments especially older
> machines with proprietary software and cloud. Transient failures tend to
> lose a lot of time especially when they happen to fail consistently in
> particular environment. Not only QE time but also dev time.
> Also test suite becomes hard to run by inexperienced with the particular
> test suite people, e.g. self-certification and certification services
> become a hard goal.
>
> That's why I think that, as stupid as it sounds, such a loop is better
> than dealing with this when least expected.
>
> Does this class throw in your environment? If it works then perhaps the
> problem is an actual bug in test controller (it works for me on fedora
> 18). And if it fails then it must be a bug in the JVM.. at least the way
> I understand mkdir() javadoc.
>
> package com.example.test;
>
> import java.io.File;
>
> public class MkdirTest {
>
> 	public static void main(String[] args) {;
> 		for ( int i=0; i<100; i++) {
> 			File newDir = new File(System.getProperty("java.io.tmpdir"),
> "mytestdir-" + Long.toHexString(System.nanoTime()));
> 			newDir.mkdir();
> 			newDir.list();
> 			newDir.delete();
> 		}
> 		System.out.println("Test run successfully");
> 	}
> }
>
> Bill Burke wrote, On 06/03/2013 07:24 PM (EEST):
>> What would be the final solution?  Loop until the directory exists?  :)
>>     I don't think so... Gotta be a delay.
>>
>> On 6/3/2013 12:15 PM, Aleksandar Kostadinov wrote:
>>> I hope this would not be the final solution. Otherwise next time we
>>> start testing on some poor machine in the cloud we may start seeing
>>> transient failures.
>>>
>>> Bill Burke wrote, On 06/03/2013 05:08 PM (EEST):
>>>> I'm getting random "Home directory does not exist" errors when building
>>>> the core-model-tests.  The thing is, its random.  4-5 times it fails,
>>>> 1-5 times it succeeds.
>>>>
>>>> So, I put a 10 millisecond delay after any mkdir() call in
>>>> TestModelControllerService and it seemed to solve the problem.  Dont'
>>>> know if its my machine, Windblows or what.  Maybe just a race condition
>>>> between JVM and the OS's file controller.
>>>>
>>> _______________________________________________
>>> wildfly-dev mailing list
>>> wildfly-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>>
>>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>


More information about the wildfly-dev mailing list