Project

General

Profile

action #59100

Race condition in os-autoinst/commands.pm

Added by tinita almost 2 years ago. Updated almost 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Concrete Bugs
Target version:
-
Start date:
2019-11-05
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

If I put a sleep 3 into the following code, then the t/full-stack.t test is failing.

Mojo::IOLoop->singleton->reactor->io($isotovideo => sub {
        my ($reactor, $writable) = @_;

        my @isotovideo_responses = myjsonrpc::read_json($isotovideo, undef, 1);

        sleep 3; # <-------------------------------------------

...
})->watch($isotovideo, 1, 0);    # watch only readable (and not writable)

The set_pause_at_test is sent via myjsonrpc::send_json(), but never read via read_json().

https://github.com/os-autoinst/os-autoinst/blob/master/commands.pm#L325-L339


Related issues

Related to openQA Project - action #59043: Fix unstable/flaky full-stack test, i.e. remove sleep, and ui testsResolved2019-11-04

History

#1 Updated by okurz almost 2 years ago

  • Category set to Concrete Bugs

#2 Updated by tinita almost 2 years ago

t/full-stack.t .. 17/?     # javascript console output: [
    #   {
    #     level     => "SEVERE",
    #     message   => "http://localhost:53373/asset/e27d1d8f48/ws_console.js 8 WebSocket connection to 'ws://127.0.0.1:20013/m6P3p9XyFV85QKzg/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED",                                       
    #     source    => "javascript",
    #     timestamp => 1572950485996,
    #   },
    # ]

...


#   Failed test 'no errors or warnings on javascript console, waiting for resume'
#   at /home/tina/openqa-devel/repos/openQA/t/lib/OpenQA/SeleniumTest.pm line 260.
# Looks like you failed 3 tests of 85.
t/full-stack .. 18/? 
#   Failed test 'pause at certain test'
#   at t/full-stack.t line 204.

#3 Updated by tinita almost 2 years ago

This can be fixed by adding:

# start of callback
$reactor->stop;

...

# end of callback
$reactor->start;

Edit:
According to Sebastian Riedel the suggested fix is wrong, and the bug is somewhere else

#4 Updated by okurz almost 2 years ago

  • Related to action #59043: Fix unstable/flaky full-stack test, i.e. remove sleep, and ui tests added

#5 Updated by tinita almost 2 years ago

  • Description updated (diff)

#6 Updated by tinita almost 2 years ago

  • Status changed from New to Rejected

Bug is elsewhere, see related ticket

Also available in: Atom PDF