Skip to content

Fix false match for running vnc#37

Merged
zzambers merged 1 commit intorh-openjdk:mainfrom
zzambers:fix-vnckill
Oct 14, 2025
Merged

Fix false match for running vnc#37
zzambers merged 1 commit intorh-openjdk:mainfrom
zzambers:fix-vnckill

Conversation

@zzambers
Copy link
Copy Markdown
Collaborator

@zzambers zzambers commented Oct 14, 2025

Grep for matching running vnc process is too liberal and can match wrong process causing test failures on some systems.
Example:

+ futureVnc=:9
+ ps -aux
+ grep -v -e grep
+ grep -e :9
root        7625  0.0  0.0      0     0 ?        I    20:25   0:00 [kworker/3:9-inode_switch_wbs]
+ echo 'special vncserver/vncsession seems to be running'
special vncserver/vncsession seems to be running
+ /mnt/ramdisk/tigervnc-1.10.0.x86_64/usr/bin/vncserver -kill :9

Can't find file /home/tester/.vnc/localhost.localdomain:9.pid
You'll have to kill the Xvnc process manually

Attempt: 5/5

Updated pattern should only match correct process (if there is one):

ps aux | grep 'vnc.*:9'
tester      6131  0.1  0.2  28036 18252 pts/1    S    12:04   0:00 tigervnc-1.10.0.x86_64/usr/bin/Xvnc :9 -auth /home/tester/.Xauthority -desktop localhost.localdomain:9 (tester) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/tes

Comment thread tests/testlib.bash
installVnc
futureVnc=":9"
if ps -aux | grep -v -e grep | grep -e "$futureVnc" ; then
if ps -aux | grep -v -e grep | grep -e "vnc.*$futureVnc" ; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the vnc. preffix really multios enough?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean? Do you think there could still be false match?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes. can it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think, this should be specific enough. (text "vnc" + display number).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oook. Good to go then. TY~!

Comment thread tests/testlib.bash Outdated
@zzambers zzambers merged commit f31d445 into rh-openjdk:main Oct 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants