Skip to content

Read SmokeTest process output asynchronously#768

Merged
zacharycmontoya merged 4 commits into
masterfrom
zach/ci/smoke-test-process-output
Jun 25, 2020
Merged

Read SmokeTest process output asynchronously#768
zacharycmontoya merged 4 commits into
masterfrom
zach/ci/smoke-test-process-output

Conversation

@zacharycmontoya

Copy link
Copy Markdown
Contributor

Additional small improvements:

  • Regardless of smoke test result, make sure it has exited or kill the process
  • For development purposes, add build dependencies so building Datadog.Trace.ClrProfiler.IntegrationsTests builds all required smoke test applications

@DataDog/apm-dotnet

@zacharycmontoya zacharycmontoya added the area:tests unit tests, integration tests label Jun 24, 2020
@zacharycmontoya
zacharycmontoya requested a review from a team as a code owner June 24, 2020 18:54
@zacharycmontoya zacharycmontoya self-assigned this Jun 24, 2020
process.BeginOutputReadLine();
process.BeginErrorReadLine();

var ranToCompletion = process.WaitForExit(MaxTestRunMilliseconds) && outputWaitHandle.WaitOne() && errorWaitHandle.WaitOne();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those waits should have a timeout as well

var standardOutput = outputBuffer.ToString();
var standardError = errorBuffer.ToString();

if (AssumeSuccessOnTimeout && !ranToCompletion)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge the two blocks

if (!ranToCompletion)
{
    Killprocess();

    if (AssumeSuccessOnTimeout)
    {
        Assert(...);
    } 
    else
    {
        Output.WriteLine;
        throw new TimeoutException(...);
    }
}

@zacharycmontoya
zacharycmontoya merged commit 14537a2 into master Jun 25, 2020
@zacharycmontoya
zacharycmontoya deleted the zach/ci/smoke-test-process-output branch June 25, 2020 21:52
@zacharycmontoya zacharycmontoya added this to the 1.18.2 milestone Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests unit tests, integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants