Review Board 1.7.22


FLUME-1088: TestWAL.testThreadedAppend fails on jenkins build server

Review Request #4634 - Created April 4, 2012 and submitted

Brock Noland
trunk
FLUME-1088
Reviewers
Flume
flume-git
Make test less intensive so it passes regularly on jenkins.

 
flume-ng-channels/flume-recoverable-memory-channel/src/test/java/org/apache/flume/channel/recoverable/memory/wal/TestWAL.java
Revision 243363e New Change
[20] 143 lines
[+20] [+] public void testReplayNone() throws IOException {
144
    Assert.assertEquals(Collections.EMPTY_LIST, actual);
144
    Assert.assertEquals(Collections.EMPTY_LIST, actual);
145
  }
145
  }
146

    
   
146

   
147
  @Test
147
  @Test
148
  public void testThreadedAppend() throws IOException, InterruptedException {
148
  public void testThreadedAppend() throws IOException, InterruptedException {
149
    int numThreads = 20;
149
    int numThreads = 10;
150
    final CountDownLatch startLatch = new CountDownLatch(numThreads);
150
    final CountDownLatch startLatch = new CountDownLatch(numThreads);
151
    final CountDownLatch stopLatch = new CountDownLatch(numThreads);
151
    final CountDownLatch stopLatch = new CountDownLatch(numThreads);
152
    final AtomicLong seqid = new AtomicLong(0);
152
    final AtomicLong seqid = new AtomicLong(0);
153
    final List<String> globalExpected = Collections.synchronizedList(new ArrayList<String>());
153
    final List<String> globalExpected = Collections.synchronizedList(new ArrayList<String>());
154
    final List<Exception> errors = Collections.synchronizedList(new ArrayList<Exception>());
154
    final List<Exception> errors = Collections.synchronizedList(new ArrayList<Exception>());
[+20] [20] 28 lines
[+20] [+] public void run() {
183
        }
183
        }
184
      };
184
      };
185
      t.setDaemon(true);
185
      t.setDaemon(true);
186
      t.start();
186
      t.start();
187
    }
187
    }
188
    Assert.assertTrue(stopLatch.await(15, TimeUnit.SECONDS));
188
    Assert.assertTrue(stopLatch.await(30, TimeUnit.SECONDS));
189
    Assert.assertEquals(Collections.EMPTY_LIST, errors);
189
    Assert.assertEquals(Collections.EMPTY_LIST, errors);
190
    wal.close();
190
    wal.close();
191
    wal = new WAL<Text>(dataDir, Text.class);
191
    wal = new WAL<Text>(dataDir, Text.class);
192
    WALReplayResult<Text> result = wal.replay();
192
    WALReplayResult<Text> result = wal.replay();
193
    Assert.assertEquals(2000, result.getSequenceID());
193
    Assert.assertEquals(2000, result.getSequenceID());
[+20] [20] 94 lines
  1. flume-ng-channels/flume-recoverable-memory-channel/src/test/java/org/apache/flume/channel/recoverable/memory/wal/TestWAL.java: Loading...