<commit_before>package com.netflix.priam.utils;

import java.io.IOException;

import org.junit.Test;

import junit.framework.Assert;

public class SystemUtilsTest
{
    @Test
    public void logProcessOutput_BadApp() throws IOException, InterruptedException
    {
        Process p = null;
        try
        {
            p = new ProcessBuilder("ls", "/tmppppp").start();
            Thread.sleep(100);
            Assert.assertFalse(0 == p.exitValue());
            SystemUtils.logProcessOutput(p);
        }
        catch(IOException ioe)
        {
            if(p!=null)
                SystemUtils.logProcessOutput(p);
        }
    }

    /**
     * note: this will succeed on a *nix machine, unclear about anything else...
     */
    @Test
    public void logProcessOutput_GoodApp() throws IOException, InterruptedException
    {
        Process p = new ProcessBuilder("true").start();
        Thread.sleep(100);
        Assert.assertEquals(0, p.exitValue());
        SystemUtils.logProcessOutput(p);
    }
}<commit_msg>use Process#waitFor instead of Thread#sleep<commit_after>package com.netflix.priam.utils;

import java.io.IOException;

import org.junit.Test;

import junit.framework.Assert;

public class SystemUtilsTest
{
    @Test
    public void logProcessOutput_BadApp() throws IOException, InterruptedException
    {
        Process p = null;
        try
        {
            p = new ProcessBuilder("ls", "/tmppppp").start();
            int exitValue = p.waitFor();
            Assert.assertTrue(0 != exitValue);
            SystemUtils.logProcessOutput(p);
        }
        catch(IOException ioe)
        {
            if(p!=null)
                SystemUtils.logProcessOutput(p);
        }
    }

    /**
     * note: this will succeed on a *nix machine, unclear about anything else...
     */
    @Test
    public void logProcessOutput_GoodApp() throws IOException, InterruptedException
    {
        Process p = new ProcessBuilder("true").start();
        int exitValue = p.waitFor();
        Assert.assertEquals(0, exitValue);
        SystemUtils.logProcessOutput(p);
    }
}
{'fraction_non_alphanumeric': 0.10661589719181343, 'fraction_numerical': 0.00475963826749167, 'mean_word_length': 2.2589147286821705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '937175', 'n_tokens_mistral': 589, 'n_tokens_neox': 574, 'n_words': 130}