Project

General

Profile

Actions

action #75346

closed

t/api/08-jobtemplates.t started failing in OBS checks

Added by okurz over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2020-10-26
Due date:
% Done:

0%

Estimated time:

Description

Observation

https://build.opensuse.org/package/live_build_log/devel:openQA/openQA/openSUSE_Factory/x86_64
showing

[ 1037s] [error] Can't call method "server" on an undefined value at /usr/lib/perl5/vendor_perl/5.30.3/Mojo/Server/Daemon.pm line 55.
[ 1037s] [debug] [TcEtNGMg] 400 Bad Request (0.008405s, 118.977/s)
[ 1037s]     ok 18 - POST /api/v1/job_templates_scheduling/1001
[ 1037s]     ok 19 - 400 Bad Request
[ 1037s]     not ok 20 - specified schema not found
[ 1037s]     1..20
[ 1037s] not ok 33 - Schema handling
...
[ 1074s] ./t/api/08-jobtemplates.t                                 (Wstat: 256 Tests: 66 Failed: 1)
[ 1074s]   Failed test:  33
[ 1074s]   Non-zero exit status: 1

also observed in devel:openQA:tested/openQA in openSUSE_Factory/x86_64 as well as
openSUSE:Factory/openQA in standard/x86_64

Steps to reproduce

  • As OBS can reproduce it likely we can locally given the right package set :)

Problem

Might be related to upgrades of any dependencies in openSUSE:Factory


Related issues 1 (0 open1 closed)

Related to openQA Project - action #75370: unstable/flaky/sporadic t/full-stack.t failing on master (circleCI) "worker did not propagate URL for os-autoinst cmd srv within 1 minute"Resolvedlivdywan2020-10-272020-11-20

Actions
Actions #1

Updated by okurz over 3 years ago

  • Related to action #75370: unstable/flaky/sporadic t/full-stack.t failing on master (circleCI) "worker did not propagate URL for os-autoinst cmd srv within 1 minute" added
Actions #2

Updated by tinita over 3 years ago

Since it was time for me to do an update, I just tested a bit and JSON::Validator seems to be the problem, but not yet sure why:

JSON::Validator 4.09: ok
JSON::Validator 4.10: fail

Actions #3

Updated by tinita over 3 years ago

It just tries several methods to load the schema file:
https://github.com/mojolicious/json-validator/blob/master/lib/JSON/Validator/Store.pm#L50

sub load {
  return
       $_[0]->_load_from_url($_[1])
    || $_[0]->_load_from_data($_[1])
    || $_[0]->_load_from_text($_[1])
    || $_[0]->_load_from_file($_[1])
    || $_[0]->_load_from_app($_[1])
    || $_[0]->get($_[1])
    || raise 'JSON::Validator::Exception', "Unable to load schema $_[1]";
}

When _load_from_file returns undef (e.g. when the file does not exist), it calls _load_from_app:
https://github.com/mojolicious/json-validator/blob/master/lib/JSON/Validator/Store.pm#L56
which fails on this line:

my $tx  = $self->ua->get($url);
Actions #4

Updated by tinita over 3 years ago

An easy workaround for us would be to check file existance/readability ourselves before passing it to JSON::Validator.

Actions #5

Updated by tinita over 3 years ago

  • Status changed from Workable to In Progress
  • Assignee set to tinita

The previous version 4.09 had a check for $self->ua->server->app before loading from a url that does not start with http.

Actions #6

Updated by tinita over 3 years ago

Reproducable also when changing the test in t/16-utils-job-templates.t from

$errors = validate_data(schema_file => 'does-not-exist', data => $template);

to

$errors = validate_data(schema_file => '/does-not-exist', data => $template);
Actions #9

Updated by tinita over 3 years ago

  • Status changed from In Progress to Resolved

PR merged, build fixed

Actions

Also available in: Atom PDF