Project

General

Profile

action #75346

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

Added by okurz 9 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Concrete Bugs
Target version:
Start date:
2020-10-26
Due date:
% Done:

0%

Estimated time:
Difficulty:

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

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"Resolved2020-10-272020-11-20

History

#1 Updated by okurz 9 months 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

#2 Updated by tinita 9 months 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

#3 Updated by tinita 9 months 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);

#4 Updated by tinita 9 months ago

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

#5 Updated by tinita 9 months 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.

#6 Updated by tinita 9 months 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);

#9 Updated by tinita 9 months ago

  • Status changed from In Progress to Resolved

PR merged, build fixed

Also available in: Atom PDF