hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arun C Murthy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MAPREDUCE-1154) Large-scale, automated test framwork for Map-Reduce
Date Sun, 25 Oct 2009 07:23:59 GMT

    [ https://issues.apache.org/jira/browse/MAPREDUCE-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769762#action_12769762

Arun C Murthy commented on MAPREDUCE-1154:


public class ClusterTest extends TestCase {

  Cluster cluster;
  Configuration conf;
  protected void setUp() throws Exception {
    conf = new Configuration();
    cluster = new Cluster(conf);

  public void testCluster() throws Exception {
    // Load data
    DataLoader dataLoader = new DistcpDataLoader();
    List<Path> inputs = new ArrayList<Path>();
    inputs.add(new Path("in"));
    dataLoader.load(inputs, new Path("out"));
    // Setup job
    Job job = Job.getInstance(cluster);

    // Run job
    long start = System.currentTimeMillis();
    long end = System.currentTimeMillis();
    FileContext fc = FileContext.getLocalFSFileContext();

    // Fetch daemon logs and validate them
    Path daemonLogs = new Path("daemon-logs");
    assertFalse("JobTracker logs contain FATAL warnings!", 
                    cluster, LogSource.JOBTRACKER, start, end, 
                    "FATAL", true, daemonLogs) == false);
    assertFalse("TaskTracker logs contain FATAL warnings!", 
                    cluster, LogSource.TASKTRACKER, start, end, 
                    "FATAL", true, daemonLogs) == false);
    fc.delete(daemonLogs, true);
    // Fetch job logs, outputs etc. and validate them
    Path jobLogs = new Path("daemon-logs");
    Path jobOutputs = new Path("daemon-logs");
    TaskAttemptID m0 = null; // map 0
    TaskAttemptID m1 = null; // map 1
    TaskAttemptID r0 = null; // reduce 0
    assertFalse("Task log contains FATAL warnings!", 
                    Artifact.LOGS, "FATAL", 
                    true, jobLogs) == false);
    assertFalse("Task log contains WARN warnings!", 
                    job, Artifact.LOGS, "WARN", 
                    false, jobLogs, m0, m1) == false);
    assertTrue("Task outputs do not contain expected output!", 
                   job, Artifact.OUTPUTS, 
                   "hello, world!", true, jobOutputs, r0));
    fc.delete(jobLogs, true);
    fc.delete(jobOutputs, true);
  protected void tearDown() throws Exception {


> Large-scale, automated test framwork for Map-Reduce
> ---------------------------------------------------
>                 Key: MAPREDUCE-1154
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1154
>             Project: Hadoop Map/Reduce
>          Issue Type: New Feature
>          Components: test
>            Reporter: Arun C Murthy
>             Fix For: 0.21.0
>         Attachments: testing.patch
> HADOOP-6332 proposes a large-scale, automated, junit-based test-framework for Hadoop.
> This jira is meant to track relevant work to Map-Reduce.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message