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
Expected behavior
Not on screen alerts
Actual behavior
System alert is shown on screen.
Hi @paulz! This is a known issue, which happens from time to time. We'll try to disable that pop-up.
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.
@paulz we can make a test for this if you provide us with reproduction steps that fail due to that window.
Thank you @miketimofeev
We can reproduce by running tests on this project:
https://github.com/sparta-science/connect/runs/739869569?check_suite_focus=true


This is blocking our UI tests
@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.
can you try one line command?:
osascript -e 'tell application "System Events" to get the title of every window of every process'
@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'
,,,,,,,,,,,,,,,,,,,,,,,,,,,
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?
@paulz I've made a test that simply checks if there is any whitespace among these commas or not, that should be enough
Genius!
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.
@paulz thank you! Will give it a try!
@paulz it turned out that setting for preventing such windows breaks network-related functional
https://github.com/actions/virtual-environments/issues/1042#issuecomment-644145685
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?
thank you for trying @miketimofeev we can totally use the AppleScript. Another proposed solution is to fix the computer name uniqueness issue: https://github.com/actions/virtual-environments/issues/1042#issuecomment-645139352 if possible.
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.

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
@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
@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!