-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Ensure Process.MainWindowTitle and Process.Responding is refreshed #38385
Ensure Process.MainWindowTitle and Process.Responding is refreshed #38385
Conversation
Tagging subscribers to this area: @eiriktsarpalis |
Thread.Sleep(100); | ||
} | ||
|
||
Assert.False(process.Responding); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question; why do we expect Responding to be false after a Refresh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this behaviour with the test program that I've written:
https://github.com/JeroenOortwijn/Responding-test
With .Net Framework 4.8, the first Process.Responding
call (immediately after Wordpad is started) returns true.
After a couple of seconds, Wordpad is so busy loading the document that the title bar shows "(Not Responding)". At that point, Process.Responding
returns false.
Due to issue #36768, Process.Responding
keeps returning true on .Net Core 3.1 and .Net 5.
var dummyFile = new FileStream(dummyFilePath, System.IO.FileMode.Create); | ||
_ = dummyFile.Seek(2048L * 1024 * 1024, SeekOrigin.Begin); | ||
dummyFile.WriteByte(0); | ||
dummyFile.Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woh, this is creating a 2GB temporary file? Even in outerloop that's probably something to be avoided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, the file is quite big.
But I want to make sure that even on the fastest machine, Wordpad goes into a "not responding" state.
If the file is too small, Wordpad will have loaded the file without getting into that state.
So, some kind of optimum file size has to be found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we really need to test that, I suggest the test itself needs to be the thing that causes the non-responsiveness, e.g. the test would RemoteExecutor.Invoke code that would create a window that's not responsive. We shouldn't depend on creating a big enough file that the particular implementation in wordpad causes the UI to hang.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephentoub you mean with something like windows forms? I tried the following
static void RunNotRespondingApp()
{
var form = new System.Windows.Forms.Form();
form.Show();
Thread.Sleep(60_000);
}
RemoteExecutor.Invoke(RunNotRespondingApp);
but for whatever reason it wasn't enough to simulate not responding state using RemoteExecutor. It does work without issue when I run as a standalone app.
@stephentoub could you please respond to @JeroenOortwijn answers to your review comments? |
5eef234
to
18f3c31
Compare
I rebased and ran the tests locally. Can confirm that the changes fix the behaviour (matching it with .NET Framework behaviour). I would recommend merging this PR ahead of the 5.0 deadline, but we could perhaps disable the problematic test (it's not run in CI anyway, and we generally have no test coverage for |
Seems reasonable to me. |
Thanks @JeroenOortwijn for your contribution! Fixes #36768. |
@dotnet/dnceng @jaredpar timeouts on “ Build OSX x64 release Runtime_Debug” and similar on a lot of.PRs right now having a significant impact. Can you help us understand why? |
@danmosemsft Looking through the logs it seems like the problem is the C++ build is just taking about 70 minutes to complete on OSX. That is eating up most of the available time for the job. |
@danmosemsft checking now |
Job timed out but it wasn't helix machine, but azdo macos machine. |
I don't see any active issue in azdo. Retried the job and checking. |
@danmosemsft now macox build job "Build product" has finished in ~56 minutes, previously it timed out in 2 hours. It seems that it was a temporary issue on AzDO side. |
@eiriktsarpalis why are we merging changes when the build legs are timing out? |
@jaredpar Apologies, I assumed by the conversation that you were discussing infra issues. Do you need me to revert? FWIW all tests were green on the initial run. The last commit was me deleting a test. |
@jakubstilec latest seems to indicate it's working again so lets keep for now and willmonitor |
We've moving from MacStadium to GitHub-hosted machines; The new machines have fewer cores. I believe the only option currently is to increase your timeouts but, as usual, I know who you can engage in conversation if you think you can talk them into making beefier mac vms. edit: this is theoretically only true for internal builds; that said they know the new machines are slower in general. |
@jaredpar is it simple to increase our timeouts? If so perhaps we should do that pre-emptively, given we expect CI to stay busy for the near future? |
PR for issue #36768.
It should fix the issue, but I'm unable to run the tests because opening the solution leads to the following NuGet error:
(Which, I think, is tracked in #34173.)