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

[WIP] Improve User-feedback for VNC sockets is not existing #862

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions OpenQA/Exceptions.pm
Expand Up @@ -32,6 +32,10 @@ use Exception::Class (
'OpenQA::Exception::VNCProtocolError' => {
description => 'VNC Server interrupted connection'
},

'OpenQA::Exception::VNCSocketError' => {
description => 'VNC Socket does not exist',
},
);

1;
10 changes: 8 additions & 2 deletions consoles/VNC.pm
Expand Up @@ -9,6 +9,8 @@ use Time::HiRes qw( usleep gettimeofday time );
use Carp;
use List::Util 'min';

use testapi 'record_info';

use Crypt::DES;
use Compress::Raw::Zlib;

Expand Down Expand Up @@ -816,7 +818,7 @@ sub _send_frame_buffer {
$args->{x},
$args->{y},
$args->{width},
$args->{height}));
$args->{height})) if $self->socket;
}

# frame buffer update request
Expand Down Expand Up @@ -878,7 +880,11 @@ sub _receive_message {
my $self = shift;

my $socket = $self->socket;
$socket or die 'socket does not exist. Probably your backend instance could not start or died.';
#$socket or die 'socket does not exist. Probably your backend instance could not start or died.';
Copy link
Member

Choose a reason for hiding this comment

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

should be deleted then but I would like to keep the text in the exception error message. We should give that hint to the test writer that probably we should not have run into that step at all, i.e. test code need to be changed or the SUT does not respond. And not "there is no socket because something is wrong in the backend"

Copy link
Member

Choose a reason for hiding this comment

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

It's done below, so I'll create another PR based on this one with commented code removed,

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in #864

if (!$socket) {
record_info('VNC Error', 'Socket does not exist', result => 'fail');
OpenQA::Exception::VNCSocketError->throw(error => 'There is no socket we can connect to.');
}
$socket->blocking(0);
my $ret = $socket->read(my $message_type, 1);
$socket->blocking(1);
Expand Down