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

Mac image starts with open system dialogs #978

Closed
1 of 5 tasks
paulz opened this issue Jun 2, 2020 · 17 comments
Closed
1 of 5 tasks

Mac image starts with open system dialogs #978

paulz opened this issue Jun 2, 2020 · 17 comments
Assignees

Comments

@paulz
Copy link

paulz commented Jun 2, 2020

Describe the bug
When image freshly booted it has open dialog saying there is already computer with the same name on the network. This blocks screenshots for our UI tests. Please dismiss the system alerts or disable them as part of boot.

Area for Triage:
Apple

Question, Bug, or Feature?:
Bug

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Expected behavior
Not on screen alerts

Actual behavior
System alert is shown on screen.

  1. Start action on Mac
  2. Capture screenshot
@miketimofeev
Copy link
Contributor

Hi @paulz! This is a known issue, which happens from time to time. We'll try to disable that pop-up.

@paulz
Copy link
Author

paulz commented Jun 2, 2020

Thank you for looking into this. Would it be possible to an automated test for macOS image so when it ever starts with open dialogs it will alert support? It takes us a lot of time to debug this issue. We spend thousands of GitHub action minutes to reproduce it because GUI access is limited.

@miketimofeev
Copy link
Contributor

@paulz we can make a test for this if you provide us with reproduction steps that fail due to that window.

@paulz
Copy link
Author

paulz commented Jun 4, 2020

Thank you @miketimofeev

We can reproduce by running tests on this project:
https://github.com/sparta-science/connect/runs/739869569?check_suite_focus=true

Screenshot_5C5C9277-CFB4-4D50-A9CB-C54C9CA458A2

Screenshot_6CADCE41-5770-4339-8933-E47AC01E5E53

This is blocking our UI tests

@miketimofeev
Copy link
Contributor

@paulz Unfortunately, we can't afford to test that issue with such a big project because it's hard to maintain. It'd be great if you can provide some very basic project, which fails if the pop-up is presented.

@miketimofeev miketimofeev added awaiting-deployment Code complete; awaiting deployment and/or deployment in progress and removed in development labels Jun 5, 2020
@paulz
Copy link
Author

paulz commented Jun 5, 2020

can you try one line command?:
osascript -e 'tell application "System Events" to get the title of every window of every process'

@miketimofeev
Copy link
Contributor

miketimofeev commented Jun 5, 2020

@paulz tried, but it didn't show much:

Mac-1307:~ runner$ osascript -e 'tell application "System Events" to get the title of every window of every process'
,,,,,,,,,,,,,,,,,,,,,,, ,,,

Looks like that whitespace is the window, because when I close it the output changes to

Mac-1307:~ runner$ osascript -e 'tell application "System Events" to get the title of every window of every process'
,,,,,,,,,,,,,,,,,,,,,,,,,,,

@paulz
Copy link
Author

paulz commented Jun 5, 2020

I am guessing it's an empty title of the window. May be test can check the list of commas have no other characters to verify no open windows?

@miketimofeev
Copy link
Contributor

@paulz I've made a test that simply checks if there is any whitespace among these commas or not, that should be enough

@paulz
Copy link
Author

paulz commented Jun 7, 2020

Genius!

@paulz
Copy link
Author

paulz commented Jun 7, 2020

Also made a utility for you to check if any window is open:

https://github.com/paulz/processes-with-open-windows

Example in action:
https://github.com/paulz/processes-with-open-windows/runs/744417311?check_suite_focus=true

Or try it in terminal:
./processes-with-open-windows; echo $?

list="$(./processes-with-open-windows)" || (test $? -eq 1 && echo "Single Window" || echo "Multiple windows:$list")

When no windows are shown it might report single Finder window showing desktop.

@miketimofeev
Copy link
Contributor

@paulz thank you! Will give it a try!

@miketimofeev
Copy link
Contributor

@paulz it turned out that setting for preventing such windows breaks network-related functional
#1042 (comment)
Is it possible to use Apple script, which should work after this week's deployment, to close the pop-up as a very first step of your pipeline until we find another workaround for the issue?

@paulz
Copy link
Author

paulz commented Jun 17, 2020

thank you for trying @miketimofeev we can totally use the AppleScript. Another proposed solution is to fix the computer name uniqueness issue: #1042 (comment) if possible.

@miketimofeev miketimofeev removed the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Jun 18, 2020
@paulz
Copy link
Author

paulz commented Jul 2, 2020

Even we run the AppleScript to close Finder windows, we still experience this system alert that computer name is already in use on the network. Probably because it's hard to predict when this alert will trigger.

86301378-9832d200-bbba-11ea-9251-1d0a253b9320

We are experimenting with renaming local hostname with this commands:

sudo scutil --set LocalHostName "SpartaConnectGitHubCI"
sudo scutil --set ComputerName "SpartaConnectGitHubCI"

Hoping that will prevent the issue from happening, will keep you posted

https://github.com/sparta-science/connect/runs/828665054?check_suite_focus=true#step:2:2

@miketimofeev
Copy link
Contributor

@paulz thanks for your suggestion! We've implemented the same fix(changing hostname at the start of the VM) and testing it now on internal environments. I'll keep you posted

@miketimofeev miketimofeev added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Jul 14, 2020
@miketimofeev
Copy link
Contributor

@paulz VM image with the fix should be available, no more open system dialogs! I'm going to close the issue but feel free to contact us if you have any concerns.
Thank you!

@miketimofeev miketimofeev removed the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants