Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StartInfo test #44392

Merged
11 commits merged into from
Nov 12, 2020
Merged

Fix StartInfo test #44392

11 commits merged into from
Nov 12, 2020

Conversation

danmoseley
Copy link
Member

Fix one of the tests in #44239
For the other, gather some small extra info -- but I have no theory why setting the apartment state is failing, if the version of Windows does support COM.

@ghost
Copy link

ghost commented Nov 8, 2020

Tagging subscribers to this area: @eiriktsarpalis, @jeffhandley
See info in area-owners.md if you want to be subscribed.

@danmoseley
Copy link
Member Author

@dotnet/dnceng any thoughts here?
https://github.com/dotnet/runtime/pull/44392/checks?check_run_id=1376226460

gzip: stdin: unexpected end of file
/bin/tar: Unexpected EOF in archive
/bin/tar: Unexpected EOF in archive
/bin/tar: Error is not recoverable: exiting now

@MattGal
Copy link
Member

MattGal commented Nov 10, 2020

@dotnet/dnceng any thoughts here?
https://github.com/dotnet/runtime/pull/44392/checks?check_run_id=1376226460

gzip: stdin: unexpected end of file
/bin/tar: Unexpected EOF in archive
/bin/tar: Unexpected EOF in archive
/bin/tar: Error is not recoverable: exiting now

Taking a look.

@MattGal
Copy link
Member

MattGal commented Nov 10, 2020

@danmosemsft this is because only the first 141 MB of the artifact was downloaded, when if it had finished it would have made it to 376-ish MB, and of course they declared victory. When you go to untar it, it rightfully says that isn't a valid file.

image

I'll go find the issue about this, but I don't think they're likely to fix it any time soon.

@danmoseley
Copy link
Member Author

So it's an Azure DevOps issue, and I should just retry?

@MattGal
Copy link
Member

MattGal commented Nov 10, 2020

So it's an Azure DevOps issue, and I should just retry?

definitely so, still finding it (lots of IMs right now)

@MattGal
Copy link
Member

MattGal commented Nov 10, 2020

No update in 109 days, but it's microsoft/azure-pipelines-tasks#13250 if you'd like to push on it.

@danmoseley
Copy link
Member Author

@jkotas any other feedback?

@@ -985,17 +981,15 @@ public void StartInfo_TextFile_ShellExecute()

try
{
process.WaitForInputIdle(); // Give the file a chance to load
Assert.Equal("notepad", process.ProcessName);

if (PlatformDetection.IsInAppContainer)
Copy link
Member

Choose a reason for hiding this comment

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

You can delete the whole IsInAppContainer block while you are on it.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

@danmoseley
Copy link
Member Author

I notice that this existing test adds up to 30 seconds to the time these tests take to run
https://github.com/danmosemsft/runtime/blob/202ab8072ae827e9b99c2fcfb9e2c4517b5696b0/src/libraries/System.Diagnostics.Process/tests/ProcessWaitingTests.cs#L640
If the goal of the large sleep is to ensure the process has started before waiting on it to exit, it might be better to do something like read something it writes to the output stream.

@danmoseley
Copy link
Member Author

danmoseley commented Nov 11, 2020

I fixed that, but there's two processes both launched by CreateProcessLong() that hold the console handles open preventing the test runner completing until they time out after 5 mins. I spent some time trying to find out which test was launching these and not killing them, but couldn't find it.

I did fix one place where dispose wasn't called, but it isn't the cause of the problem.

@danmoseley
Copy link
Member Author

@akoeplinger Android timed out.

@ghost
Copy link

ghost commented Nov 11, 2020

Hello @danmosemsft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@danmoseley
Copy link
Member Author

@jkotas can you sign off?

@@ -639,13 +639,17 @@ public async Task WaitAsyncForSelfTerminatingChild()
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
public async Task WaitAsyncForProcess()
{
Process p = CreateSleepProcess(WaitInMS);
Process p = CreateProcessPortable(RemotelyInvokable.SleepWithWrite, "1000");
p.StartInfo.RedirectStandardOutput = true;
Copy link
Member

Choose a reason for hiding this comment

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

I am not able to figure out what this is trying to fix and why it works. Could you please elaborate?

I believe that this fix is not quite right. If the stdout buffer is small or non-existing, the test will hang. The process will be stuck on writing to stdout. This write will never end because of ReadToEnd that reads from other side of the pipe is done only after the process exits.

Copy link
Member Author

Choose a reason for hiding this comment

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

As written, WaitAsyncForProcess takes at least 30 seconds to complete. That is because it waits on the first to finish of: a process that sleeps for 30 seconds, and a 60 second delay. The other tests are mostly finished by the time it starts, so it causes the test run to wait that long. (Although, having mitigated that, there is a subsequent 5 minute delay as mentioned above)

If this delay was intentional I guess it was to try to avoid the process exiting before waiting on it to exit. So, I was hoping to find a way to block the child process from exiting until WaitForExitAsync() is called.

Copy link
Member

Choose a reason for hiding this comment

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

Can we make the test outer loop instead?

Copy link
Member Author

@danmoseley danmoseley Nov 11, 2020

Choose a reason for hiding this comment

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

Perhaps I can use an event such as in WaitForSignal().

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I'll do that for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, and opened issue.

@danmoseley
Copy link
Member Author

Installer failure is #43917
Android failure is affecting many PR's and it already passed Android once.

@danmoseley
Copy link
Member Author

Libraries checked coreclr Linux run is failed installer. I will try one more time.

@danmoseley
Copy link
Member Author

@dotnet/dnceng is this known?

2020-11-11T19:22:15.5812153Z ./build.sh -subset libs.pretest -rc checked -configuration Debug -ci -arch x64 -framework net6.0  -testscope innerloop     /p:RuntimeArtifactsPath=/datadisks/disk1/workspace/_work/1/s/artifacts/transport/coreclr  /p:RuntimeFlavor=coreclr /bl:/datadisks/disk1/workspace/_work/1/s/artifacts/log/Debug/overrideRuntimeFromLiveDrop.binlog
2020-11-11T19:22:15.5813789Z ========================== Starting Command Output ===========================
2020-11-11T19:22:15.5830529Z [command]/bin/bash --noprofile --norc /datadisks/disk1/workspace/_work/_temp/7380dd9d-d004-4979-9473-813fcccc5b1a.sh
2020-11-11T19:22:16.2532395Z __DistroRid: linux-x64
2020-11-11T19:22:16.2533137Z __RuntimeId: linux-x64
2020-11-11T19:22:16.3034880Z Downloading 'https://dot.net/v1/dotnet-install.sh'
2020-11-11T19:22:16.3036139Z Trying to run 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh' for maximum of 5 attempts.
2020-11-11T19:22:16.5309775Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:16.5371274Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 3 seconds before next attempt (2 out of 5).
2020-11-11T19:22:19.7042576Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:19.7105078Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 7 seconds before next attempt (3 out of 5).
2020-11-11T19:22:26.8671014Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:26.8732443Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 15 seconds before next attempt (4 out of 5).
2020-11-11T19:22:42.0370656Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:42.0439145Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 31 seconds before next attempt (5 out of 5).
2020-11-11T19:23:13.2061439Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:23:13.2130659Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 63 seconds before next attempt (6 out of 5).
2020-11-11T19:24:16.2141463Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh' for 5 times.
2020-11-11T19:24:16.2212704Z ##[error](NETCORE_ENGINEERING_TELEMETRY=InitializeToolset) Failed to acquire dotnet install script (exit code '1').
2020-11-11T19:24:16.2220776Z ##[error]Bash exited with code '1'.
2020-11-11T19:24:16.2242161Z ##[section]Finishing: Prepare TestHost with runtime CoreCLR

@ghost ghost merged commit a207c7f into dotnet:master Nov 12, 2020
@danmoseley danmoseley deleted the notepadtest branch November 12, 2020 03:46
@MattGal
Copy link
Member

MattGal commented Nov 12, 2020

@dotnet/dnceng is this known?

2020-11-11T19:22:15.5812153Z ./build.sh -subset libs.pretest -rc checked -configuration Debug -ci -arch x64 -framework net6.0  -testscope innerloop     /p:RuntimeArtifactsPath=/datadisks/disk1/workspace/_work/1/s/artifacts/transport/coreclr  /p:RuntimeFlavor=coreclr /bl:/datadisks/disk1/workspace/_work/1/s/artifacts/log/Debug/overrideRuntimeFromLiveDrop.binlog
2020-11-11T19:22:15.5813789Z ========================== Starting Command Output ===========================
2020-11-11T19:22:15.5830529Z [command]/bin/bash --noprofile --norc /datadisks/disk1/workspace/_work/_temp/7380dd9d-d004-4979-9473-813fcccc5b1a.sh
2020-11-11T19:22:16.2532395Z __DistroRid: linux-x64
2020-11-11T19:22:16.2533137Z __RuntimeId: linux-x64
2020-11-11T19:22:16.3034880Z Downloading 'https://dot.net/v1/dotnet-install.sh'
2020-11-11T19:22:16.3036139Z Trying to run 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh' for maximum of 5 attempts.
2020-11-11T19:22:16.5309775Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:16.5371274Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 3 seconds before next attempt (2 out of 5).
2020-11-11T19:22:19.7042576Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:19.7105078Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 7 seconds before next attempt (3 out of 5).
2020-11-11T19:22:26.8671014Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:26.8732443Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 15 seconds before next attempt (4 out of 5).
2020-11-11T19:22:42.0370656Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:22:42.0439145Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 31 seconds before next attempt (5 out of 5).
2020-11-11T19:23:13.2061439Z curl: (51) SSL: certificate subject name (*.azureedge.net) does not match target host name 'dotnet.microsoft.com'
2020-11-11T19:23:13.2130659Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh'. Waiting 63 seconds before next attempt (6 out of 5).
2020-11-11T19:24:16.2141463Z Failed to execute 'curl https://dot.net/v1/dotnet-install.sh -sSL --retry 10 --create-dirs -o /datadisks/disk1/workspace/_work/1/s/.dotnet/dotnet-install.sh' for 5 times.
2020-11-11T19:24:16.2212704Z ##[error](NETCORE_ENGINEERING_TELEMETRY=InitializeToolset) Failed to acquire dotnet install script (exit code '1').
2020-11-11T19:24:16.2220776Z ##[error]Bash exited with code '1'.
2020-11-11T19:24:16.2242161Z ##[section]Finishing: Prepare TestHost with runtime CoreCLR

Yes, I will add you to a thread.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
@danmoseley danmoseley restored the notepadtest branch December 22, 2020 05:06
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants