Minor tweaks to the crawler test. Added a flush needed under still obscure

high stress situations to prevent a duplicate key violation, in 
PlainDirectoryNodeImpl.  This only makes sense if somehow the second level cache
is getting out of whack.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-08 11:37:28 +00:00
parent cdef918e07
commit a58a3c4f53
5 changed files with 20 additions and 17 deletions

View File

@@ -127,6 +127,7 @@ class AVMCrawler implements Runnable
}
}
AVMNodeDescriptor dir = dirs.get(fRandom.nextInt(dirs.size()));
int depth = 1;
while (dir != null)
{
Map<String, AVMNodeDescriptor> listing = fService.getDirectoryListing(-1, dir.getPath());
@@ -168,17 +169,16 @@ class AVMCrawler implements Runnable
fOpCount++;
}
}
// Create some files.
for (int i = 0; i < 1; i++)
if (fRandom.nextInt(depth) < depth - 1)
{
String name = randomName();
fService.createFile(dir.getPath(), name,
// Create some files.
for (int i = 0; i < 1; i++)
{
String name = randomName();
fService.createFile(dir.getPath(), name,
new ByteArrayInputStream(("I am " + name).getBytes()));
fOpCount++;
// PrintStream out = new PrintStream(fService.createFile(dir.getPath(), name));
// fOpCount++;
// out.println("I am " + name);
// out.close();
fOpCount++;
}
}
// 1 in 100 times create a directory.
if (fRandom.nextInt(100) == 0)
@@ -206,6 +206,7 @@ class AVMCrawler implements Runnable
{
dir = null;
}
depth++;
}
if (fRandom.nextInt(16) == 0)
{
@@ -221,7 +222,8 @@ class AVMCrawler implements Runnable
return;
}
e.printStackTrace(System.err);
throw new AVMException("Failure", e);
return;
// throw new AVMException("Failure", e);
}
}