<commit_before>﻿using System;
using System.Diagnostics;

namespace Xappy
{
    public class TestRunner
    {
        private readonly string _vsTestPath;

        public TestRunner(string vsTestPath)
        {
            _vsTestPath = vsTestPath;
        }

        public string ProcessBuild(string parameters)
        {
            var proc = new Process();
            var info = new ProcessStartInfo();
            info.FileName = _vsTestPath;
            info.Arguments = parameters + " /InIsolation";
            info.RedirectStandardError = true;
            info.RedirectStandardInput = true;
            info.RedirectStandardOutput = true;
            info.UseShellExecute = false;
            proc.StartInfo = info;
            proc.Start();
            proc.WaitForExit();
            return String.Join("\n", new[] { "Test run commandline: ", info.FileName + " " + info.Arguments, 
                proc.StandardOutput.ReadToEnd(), proc.StandardError.ReadToEnd() });
        }
    }
}<commit_msg>* collect output before waiting on process exit   - prevents deadlock when there is more output than the buffer     can hold, whereby the console app waits for the buffer to be     cleared and the launching process is waiting for the console     app to exit before clearing the buffer<commit_after>﻿using System;
using System.Diagnostics;

namespace Xappy
{
    public class TestRunner
    {
        private readonly string _vsTestPath;

        public TestRunner(string vsTestPath)
        {
            _vsTestPath = vsTestPath;
        }

        public string ProcessBuild(string parameters)
        {
            var proc = new Process();
            var info = new ProcessStartInfo();
            info.FileName = _vsTestPath;
            info.Arguments = parameters + " /InIsolation";
            info.RedirectStandardError = true;
            info.RedirectStandardInput = true;
            info.RedirectStandardOutput = true;
            info.UseShellExecute = false;
            proc.StartInfo = info;
            proc.Start();
            var result = String.Join("\n", new[] { "Test run commandline: ", info.FileName + " " + info.Arguments, 
                proc.StandardOutput.ReadToEnd(), proc.StandardError.ReadToEnd() });
            proc.WaitForExit();
            return result;
        }
    }
}
{'fraction_non_alphanumeric': 0.08405172413793104, 'fraction_numerical': 0.0, 'mean_word_length': 2.0103761348897535, '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': '4302511', 'n_tokens_mistral': 572, 'n_tokens_neox': 562, 'n_words': 163}