Bug 1729973 - openqa-4.6-15.20190603git8a35385.fc31 FTBFS: Failed test 'Verify chunks fail' at ./t/31-client_file.t line 170.
Summary: openqa-4.6-15.20190603git8a35385.fc31 FTBFS: Failed test 'Verify chunks fail'...
Alias: None
Product: Fedora
Classification: Fedora
Component: openqa
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Adam Williamson
QA Contact: Fedora Extras Quality Assurance
URL: https://apps.fedoraproject.org/kosche...
Depends On:
TreeView+ depends on / blocked
Reported: 2019-07-15 13:03 UTC by Petr Pisar
Modified: 2019-07-19 03:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-07-19 03:23:11 UTC
Type: Bug

Attachments (Terms of Use)

Description Petr Pisar 2019-07-15 13:03:23 UTC
openqa-4.6-15.20190603git8a35385.fc31 fails to build in F31 because two tests fail:

BUILDSTDERR: 2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.00215972 s, 971 MB/s
BUILDSTDERR:     #   Failed test 'Verify chunks fail'
BUILDSTDERR:     #   at ./t/31-client_file.t line 170.
BUILDSTDERR:     #          got: 'Can't verify written data from chunk
BUILDSTDERR:     #     expected: 'Can't verify written data from chunk'
BUILDSTDERR:     # Looks like you failed 1 test of 8.
BUILDSTDERR: #   Failed test 'verify_chunks'
BUILDSTDERR: #   at ./t/31-client_file.t line 176.
Test Summary Report
./t/31-client_file.t                    (Wstat: 256 Tests: 6 Failed: 1)
  Failed test:  5
  Non-zero exit status: 1
./t/api/08-jobtemplates.t               (Wstat: 256 Tests: 76 Failed: 1)
  Failed test:  61
  Non-zero exit status: 1

A difference between passing and failing build root is at <https://apps.fedoraproject.org/koschei/build/6682130>.

The ./t/31-client_file.t failure is triggered by upgrading perl-Mojolicious from 8.18-1.fc31 to 8.20-1.fc31.

Comment 1 Oliver Kurz 2019-07-15 16:36:24 UTC
Interesting, so the test now outputs an additional newline.

Comment 2 Adam Williamson 2019-07-15 23:02:01 UTC
OK, I have this figured out now. Note this subtest happens to have two parts which use more or less the same check, quite close together:

        OpenQA::Files->verify_chunks($t_dir => $copied_file)->message(),
        'Can\'t verify written data from chunk',
        'Cannot verify chunks passes'


        OpenQA::Files->verify_chunks($t_dir => $copied_file),
        'Can\'t verify written data from chunk',
        'Verify chunks fail'

but notice the *first* one does `->message()` on the result of the function, but the *second* does not. It seems as if the first is still passing, but the second is failing - we have a failure for "Verify chunks fail", not for "Cannot verify chunks passes". So, I went to look at the source: https://github.com/mojolicious/mojo/blob/master/lib/Mojo/Exception.pm . This bit:

  use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1;

means that if you evaluate an Exception in string context, what you get is the result of its to_string method; if we look at to_string as it stands in current Mojo git master, it does this:

  my $str = $self->message;
  $str .= "\n" unless $str =~ /\n$/;

which sure looks like it sticks a newline on the end if there isn't one there already. So, did that change recently? Why yes it did, in this commit:


That removed a rather important line! Before that commit, the same bit in to_string looked like this:

  my $str = $self->message;
  return $str unless $self->verbose;

  $str .= "\n" unless $str =~ /\n$/;

so, yeah. That change in 8.19 means we get a newline at the end when we evaluate the Exception instance in string context where previously we didn't. But using the `message` instead of evaluating the Exception instance works fine.

So, I'd say we should probably change two things here: change the second line in the test to use `message` like the first line does, as that's going to be a more robust approach in general, and raise an issue on Mojo to point out this possibly unintended consequence of all the changes to Exception in 8.19. I'll do both of those.

Comment 3 Adam Williamson 2019-07-15 23:23:20 UTC

I'll update the Rawhide openQA package with the PR included.

Comment 4 Adam Williamson 2019-07-19 03:23:11 UTC
OK, fixed now (had to fix a bunch of other stuff too).

Note You need to log in before you can comment on or make changes to this bug.