448449450451452453454455456457458
// happens quickly by triggering deletion reports and replication // work calculation frequently. harness.addReplicationTriggerThread(500); harness.addFailoverThread(5000); harness.startThreads(); testers.startThreads(); testers.waitFor(STRESS_RUNTIME); testers.stop(); harness.stopThreads(); } finally {
262263264265266267268269270271272
try { TestContext ctx = setupClientTestContext(opts); if (ctx != null) { long totalCalls = 0; ctx.startThreads(); long veryStart = System.nanoTime(); // Loop printing results every second until the specified // time has elapsed for (int i = 0; i < opts.secondsToRun ; i++) {
126127128129130131132133134135136
// happens quickly by triggering deletion reports and replication // work calculation frequently. harness.addReplicationTriggerThread(500); harness.addFailoverThread(5000); harness.startThreads(); togglers.startThreads(); togglers.waitFor(RUNTIME); togglers.stop(); harness.stopThreads();
378379380381382383384385386387388
273274275276277278279280281282283
cluster.transitionToStandby(0); Thread.sleep(50); cluster.transitionToActive(0); } }); ctx.startThreads(); ctx.waitFor(20000); ctx.stop(); } finally { cluster.shutdown(); }
274275276277278279280281282283284
246247248249250251252253254255256
4445464748495051525354
threadsRun.incrementAndGet(); } }); } assertEquals(0, threadsRun.get()); ctx.startThreads(); long st = System.currentTimeMillis(); ctx.waitFor(30000); long et = System.currentTimeMillis(); // All threads should have run
6667686970717273747576
@Override public void doWork() throws Exception { fail(FAIL_MSG); } }); ctx.startThreads(); long st = System.currentTimeMillis(); try { ctx.waitFor(30000); fail("waitFor did not throw"); } catch (RuntimeException rte) {
919293949596979899100101
@Override public void doWork() throws Exception { throw new IOException("my ioe"); } }); ctx.startThreads(); long st = System.currentTimeMillis(); try { ctx.waitFor(30000); fail("waitFor did not throw"); } catch (RuntimeException rte) {