Skip to content

Commit

Permalink
Increase the timeouts used in PageCacheTest.writeLockingCursorMustThr…
Browse files Browse the repository at this point in the history
…owWhenLockingPageRacesWithUnmapping

This should reduce the probability of that test spuriously failing.
  • Loading branch information
chrisvest committed Aug 21, 2015
1 parent 5bd3759 commit 9c91c2e
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -2726,7 +2726,7 @@ public void readingAndRetryingOnPageWithOptimisticReadLockingAfterUnmappingMustN
}

@RepeatRule.Repeat( times = 100 )
@Test( timeout = 10000 )
@Test( timeout = 30000 )
public void writeLockingCursorMustThrowWhenLockingPageRacesWithUnmapping() throws Exception
{
// Even if we block in pin, waiting to grab a lock on a page that is
Expand All @@ -2738,11 +2738,12 @@ public void writeLockingCursorMustThrowWhenLockingPageRacesWithUnmapping() throw
// Conversely, we don't have to go to the same lengths for read locked
// pages, because those are never changed. Not by us, anyway.

generateFileWithRecords( file( "a" ), recordsPerFilePage * 2, recordSize );
File file = file( "a" );
generateFileWithRecords( file, recordsPerFilePage * 2, recordSize );

getPageCache( fs, maxPages, pageCachePageSize, PageCacheTracer.NULL );

final PagedFile pf = pageCache.map( file( "a" ), filePageSize );
final PagedFile pf = pageCache.map( file, filePageSize );
final CountDownLatch hasLockLatch = new CountDownLatch( 1 );
final CountDownLatch unlockLatch = new CountDownLatch( 1 );
final CountDownLatch secondThreadGotLockLatch = new CountDownLatch( 1 );
Expand Down Expand Up @@ -2790,7 +2791,7 @@ public Object call() throws Exception

try
{
closeFuture.get( 10, TimeUnit.MILLISECONDS );
closeFuture.get( 100, TimeUnit.MILLISECONDS );
fail( "Expected a TimeoutException here" );
}
catch ( TimeoutException e )
Expand All @@ -2810,7 +2811,7 @@ public Object call() throws Exception

try
{
closeFuture.get( 200, TimeUnit.MILLISECONDS );
closeFuture.get( 1000, TimeUnit.MILLISECONDS );
// The closeFuture got it first, so the takeLockFuture should throw.
try
{
Expand All @@ -2830,7 +2831,7 @@ public Object call() throws Exception
// The takeLockFuture got it first, so the closeFuture should
// complete when we release the latch.
secondThreadGotLockLatch.countDown();
closeFuture.get( 200, TimeUnit.MILLISECONDS );
closeFuture.get( 2000, TimeUnit.MILLISECONDS );
}
}

Expand Down

0 comments on commit 9c91c2e

Please sign in to comment.