Package org.apache.hadoop.test.MultithreadedTestUtil

Examples of org.apache.hadoop.test.MultithreadedTestUtil.TestContext.waitFor()


        counter.incrementAndGet();
      }
    });
    ctx.startThreads();
    long st = System.currentTimeMillis();
    ctx.waitFor(3000);
    ctx.stop();
    long et = System.currentTimeMillis();
    long elapsed = et - st;

    // Test should have waited just about 3 seconds
View Full Code Here


      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      testers.startThreads();
     
      testers.waitFor(STRESS_RUNTIME);
      testers.stop();
      harness.stopThreads();
    } finally {
      System.err.println("===========================\n\n\n\n");
      harness.shutdown();
View Full Code Here

          Thread.sleep(50);
          cluster.transitionToActive(0);
        }
      });
      ctx.startThreads();
      ctx.waitFor(20000);
      ctx.stop();
    } finally {
      cluster.shutdown();
    }
  }
View Full Code Here

      });
    }
    assertEquals(0, threadsRun.get());
    ctx.startThreads();
    long st = Time.now();
    ctx.waitFor(30000);
    long et = Time.now();

    // All threads should have run
    assertEquals(3, threadsRun.get());
    // Test shouldn't have waited the full 30 seconds, since
View Full Code Here

      }
    });
    ctx.startThreads();
    long st = Time.now();
    try {
      ctx.waitFor(30000);
      fail("waitFor did not throw");
    } catch (RuntimeException rte) {
      // expected
      assertEquals(FAIL_MSG, rte.getCause().getMessage());
    }
View Full Code Here

      }
    });
    ctx.startThreads();
    long st = Time.now();
    try {
      ctx.waitFor(30000);
      fail("waitFor did not throw");
    } catch (RuntimeException rte) {
      // expected
      assertEquals("my ioe", rte.getCause().getMessage());
    }
View Full Code Here

        counter.incrementAndGet();
      }
    });
    ctx.startThreads();
    long st = Time.now();
    ctx.waitFor(3000);
    ctx.stop();
    long et = Time.now();
    long elapsed = et - st;

    // Test should have waited just about 3 seconds
View Full Code Here

      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      togglers.startThreads();
     
      togglers.waitFor(RUNTIME);
      togglers.stop();
      harness.stopThreads();

      // CHeck that the files can be read without throwing
      for (int i = 0; i < NUM_THREADS; i++) {
View Full Code Here

      harness.addReplicationTriggerThread(500);
      harness.addFailoverThread(5000);
      harness.startThreads();
      testers.startThreads();
     
      testers.waitFor(STRESS_RUNTIME);
      testers.stop();
      harness.stopThreads();
    } finally {
      System.err.println("===========================\n\n\n\n");
      harness.shutdown();
View Full Code Here

          Thread.sleep(50);
          cluster.transitionToActive(0);
        }
      });
      ctx.startThreads();
      ctx.waitFor(20000);
      ctx.stop();
    } finally {
      cluster.shutdown();
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.