summaryrefslogtreecommitdiffstats
path: root/scripts/generic/t/21-testrunner-flaky.t
blob: d336f82d3809d162fcacf87c16d9bdabb15f8404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;

=head1 NAME

21-testrunner-flaky.t - test testrunner's `flaky' plugin for unstable tests

=head1 SYNOPSIS

  perl ./21-testrunner-flaky.t

This test will run the testrunner.pl script with some artificially unstable
processes and verify that the flaky plugin generates the expected output.

=cut

use Capture::Tiny qw( capture );
use English qw( -no_match_vars );
use File::Basename;
use File::Slurp qw( read_file );
use File::Temp qw( tempdir );
use FindBin;
use Readonly;
use Test::More;

use lib "$FindBin::Bin/../../lib/perl5";
use QtQA::Test::More qw( is_or_like );

# error from a stable failing test
Readonly my $ERROR_STABLE_FAILURE => <<'END_MESSAGE';
QtQA::App::TestRunner: test failed, running again to see if it is flaky...
QtQA::App::TestRunner: test failure could be reproduced twice consecutively
END_MESSAGE

# perl to simulate a test which fails, then succeeds.
Readonly my $PERL_VANISHING_FAILURE => <<'END_SCRIPT';
$|++;
if ($ENV{ QTQA_APP_TESTRUNNER_ATTEMPT } == 1) {
    print qq{First attempt; failing...\n};
    exit 13;
}
print qq{Second attempt; causing much vexation by passing!\n};
END_SCRIPT

# perl to simulate a test which eventually fails, then eventually succeeds.
Readonly my $PERL_VANISHING_FAILURE_TIMEOUT_WARNING => <<'END_SCRIPT';
sleep 2;
$|++;
if ($ENV{ QTQA_APP_TESTRUNNER_ATTEMPT } == 1) {
    print qq{First attempt; failing...\n};
    exit 13;
}
print qq{Second attempt; causing much vexation by passing!\n};
END_SCRIPT

# stdout from the above
Readonly my $OUTPUT_VANISHING_FAILURE => <<'END_MESSAGE';
First attempt; failing...
Second attempt; causing much vexation by passing!
END_MESSAGE

# error from the above
Readonly my $ERROR_VANISHING_FAILURE => <<'END_MESSAGE';
QtQA::App::TestRunner: test failed, running again to see if it is flaky...
QtQA::App::TestRunner: test failed on first attempt and passed on second attempt!
QtQA::App::TestRunner:   first attempt:  exited with exit code 13
QtQA::App::TestRunner: the test seems to be flaky, please fix this
END_MESSAGE

# above, in `pass' flaky mode
Readonly my $ERROR_VANISHING_FAILURE_MODE_BEST => $ERROR_VANISHING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being treated as a PASS
END_MESSAGE

# above, in `fail' flaky mode
Readonly my $ERROR_VANISHING_FAILURE_MODE_WORST => $ERROR_VANISHING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being treated as a FAIL
END_MESSAGE

# above, in `ignore' flaky mode
Readonly my $ERROR_VANISHING_FAILURE_MODE_IGNORE => $ERROR_VANISHING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being ignored
END_MESSAGE

# perl to simulate a test which fails by crashing, then succeeds.
Readonly my $PERL_VANISHING_CRASH => <<'END_SCRIPT';
$|++;
if ($ENV{ QTQA_APP_TESTRUNNER_ATTEMPT } == 1) {
    print qq{First attempt; crashing...\n};
    kill 11, $$;
}
print qq{Second attempt; causing much vexation by passing!\n};
END_SCRIPT

# stdout from the above
Readonly my $OUTPUT_VANISHING_CRASH => <<'END_MESSAGE';
First attempt; crashing...
Second attempt; causing much vexation by passing!
END_MESSAGE

# helper regexes for building up the larger regexes below
Readonly my $RE => {
    flaky_first_fail  => qr{
\QQtQA::App::TestRunner: test failed, running again to see if it is flaky...\E\n
    }xms,

    core_backtrace    => qr{
\QQtQA::App::TestRunner: ============================== backtrace follows: ==============================\E \n
(?:QtQA::App::TestRunner: [^\n]+ \n)*
\QQtQA::App::TestRunner: Program terminated with signal \E(?:11|SIGSEGV)\Q, Segmentation fault.\E                           \n
(?:QtQA::App::TestRunner: [^\n]+ \n)*
\QQtQA::App::TestRunner: ================================================================================\E \n
    }xms,

    exited_with_signal11 => ($OSNAME =~ m{win32}i) ? qr{} : qr{
\QQtQA::App::TestRunner: Process exited due to signal 11; dumped core\E                                     \n
    }xms,

    exited_with_any_signal => ($OSNAME =~ m{win32}i) ? qr{} : qr{
\QQtQA::App::TestRunner: Process exited due to signal \E \d+ (?:\Q; dumped core\E)?                         \n
    }xms,

    flaky_second_pass => qr{
\QQtQA::App::TestRunner: test failed on first attempt and passed on second attempt!\E                       \n
\QQtQA::App::TestRunner:   first attempt:  exited with signal 11\E                                          \n
\QQtQA::App::TestRunner: the test seems to be flaky, please fix this\E                                      \n
\QQtQA::App::TestRunner: this flaky test is being treated as a FAIL\E                                       \n
    }xms,

    verbose_begin => qr{\QQtQA::App::TestRunner: begin \E.*?:\Q [perl]\E[^\n]*},
    verbose_end   => qr{\QQtQA::App::TestRunner: end \E[^:]+\Q: \E[^\n]*},
};

# perl to simulate a test which hangs (for 10 seconds)
Readonly my $PERL_HANGING_FAILURE => <<'END_SCRIPT';
$|++;
print qq{About to hang for a few seconds...\n};
sleep 10;
print qq{Still alive!?!? Most unexpected ...\n};
exit 0;
END_SCRIPT

# stdout from the above
Readonly my $OUTPUT_HANGING_FAILURE => <<'END_MESSAGE';
About to hang for a few seconds...
About to hang for a few seconds...
END_MESSAGE


# error from hanging test
Readonly my $ERROR_HANGING_FAILURE => qr|
    \QQtQA::App::TestRunner: Timed out after \E \d+ \Q seconds\E \n
    $RE->{ exited_with_any_signal }
    \QQtQA::App::TestRunner: test failed, running again to see if it is flaky...\E \n
    \QQtQA::App::TestRunner: Timed out after \E \d+ \Q seconds\E \n
    $RE->{ exited_with_any_signal }
    \QQtQA::App::TestRunner: test failure could be reproduced twice consecutively\E \n
|xms;

# error from the above (when using "flaky" and "core" plugins, in that order)
# note: hardcoded 3328 == (13 << 8)
Readonly my $ERROR_VANISHING_CRASH_WITH_FLAKY_AND_CORE => qr|
\A
    $RE->{ exited_with_signal11 } # testrunner tells us that the test exited with signal 11...
    $RE->{ flaky_first_fail }   # `flaky' says it fails, will try again...
    $RE->{ core_backtrace }     # `core' shows the backtrace from the first fail
    $RE->{ flaky_second_pass }  # `flaky' says it passed on second try
\z
|xms;

# merged stdout/stderr from the above
Readonly my $LOG_VANISHING_CRASH_WITH_FLAKY_AND_CORE => qr|
\A
    \QFirst attempt; crashing...\E \n
    $RE->{ exited_with_signal11 }
    $RE->{ flaky_first_fail }
    $RE->{ core_backtrace }
    \QSecond attempt; causing much vexation by passing!\E \n
    $RE->{ flaky_second_pass }
\z
|xms;

# error from the above (when using "core" and "flaky" plugins, in that order)
# Note the only difference from above is that some output order is switched
Readonly my $ERROR_VANISHING_CRASH_WITH_CORE_AND_FLAKY => qr|
\A
    $RE->{ exited_with_signal11 } # testrunner tells us that the test exited with signal 11
    $RE->{ core_backtrace }     # `core' shows the backtrace from the first fail
    $RE->{ flaky_first_fail }   # `flaky' says it fails, will try again...
    $RE->{ flaky_second_pass }  # `flaky' says it passed on second try
\z
|xms;

# merged stdout/stderr from the above
Readonly my $LOG_VANISHING_CRASH_WITH_CORE_AND_FLAKY => qr|
\A
    \QFirst attempt; crashing...\E \n
    $RE->{ exited_with_signal11 }
    $RE->{ core_backtrace }
    $RE->{ flaky_first_fail }
    \QSecond attempt; causing much vexation by passing!\E \n
    $RE->{ flaky_second_pass }
\z
|xms;

# perl to simulate a test which fails, then fails again in a different way
Readonly my $PERL_DIFFERING_FAILURE => <<'END_SCRIPT';
$|++;
if ($ENV{ QTQA_APP_TESTRUNNER_ATTEMPT } == 1) {
    print qq{First attempt; failing...\n};
    exit 13;
}
print qq{Second attempt; failing again, differently\n};
exit 22;
END_SCRIPT

# stdout from the above
Readonly my $OUTPUT_DIFFERING_FAILURE => <<'END_MESSAGE';
First attempt; failing...
Second attempt; failing again, differently
END_MESSAGE

# error from the above
Readonly my $ERROR_DIFFERING_FAILURE => <<'END_MESSAGE';
QtQA::App::TestRunner: test failed, running again to see if it is flaky...
QtQA::App::TestRunner: test failed on first and second attempts, but with different behavior each time:
QtQA::App::TestRunner:   first attempt:  exited with exit code 13
QtQA::App::TestRunner:   second attempt: exited with exit code 22
QtQA::App::TestRunner: the test seems to be flaky, please fix this
END_MESSAGE

# above, in `pass' flaky mode
Readonly my $ERROR_DIFFERING_FAILURE_MODE_BEST => $ERROR_DIFFERING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being treated as a FAIL
END_MESSAGE

# above, in `fail' flaky mode
Readonly my $ERROR_DIFFERING_FAILURE_MODE_WORST => $ERROR_DIFFERING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being treated as a FAIL
END_MESSAGE

# above, with --verbose
Readonly my $VERBOSE_ERROR_DIFFERING_FAILURE_MODE_WORST => qr|
\A
$RE->{ verbose_begin }\n
\Q$ERROR_DIFFERING_FAILURE_MODE_WORST\E
$RE->{ verbose_end }\Q, exit code 22\E\n
|xms;

# above, in `ignore' flaky mode
Readonly my $ERROR_DIFFERING_FAILURE_MODE_IGNORE => $ERROR_DIFFERING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being ignored
END_MESSAGE

# stdout & stderr mixed from the above
Readonly my $LOG_DIFFERING_FAILURE => <<'END_MESSAGE';
First attempt; failing...
QtQA::App::TestRunner: test failed, running again to see if it is flaky...
Second attempt; failing again, differently
QtQA::App::TestRunner: test failed on first and second attempts, but with different behavior each time:
QtQA::App::TestRunner:   first attempt:  exited with exit code 13
QtQA::App::TestRunner:   second attempt: exited with exit code 22
QtQA::App::TestRunner: the test seems to be flaky, please fix this
END_MESSAGE

# above, in `pass' flaky mode
Readonly my $LOG_DIFFERING_FAILURE_MODE_BEST => $LOG_DIFFERING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being treated as a FAIL
END_MESSAGE

# above, in `fail' flaky mode
Readonly my $LOG_DIFFERING_FAILURE_MODE_WORST => $LOG_DIFFERING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being treated as a FAIL
END_MESSAGE

# above, in `ignore' flaky mode
Readonly my $LOG_DIFFERING_FAILURE_MODE_IGNORE => $LOG_DIFFERING_FAILURE . <<"END_MESSAGE";
QtQA::App::TestRunner: this flaky test is being ignored
END_MESSAGE

# perl to check if -silent argument is passed (and fail)
Readonly my $PERL_SILENT_CHECK => <<'END_SCRIPT';
if (grep { $_ eq '-silent' } @ARGV) {
    print qq{-silent argument is given; }.scalar(@ARGV).qq{ args\n};
} else {
    print qq{-silent argument is not given; }.scalar(@ARGV).qq{ args\n};
}
exit 16;
END_SCRIPT

# expected output from the above, when run with -silent -foo
Readonly my $OUTPUT_SILENT_CHECK => <<'END_MESSAGE';
-silent argument is given; 2 args
-silent argument is not given; 1 args
END_MESSAGE

# expected stderr from the above
Readonly my $ERROR_SILENT_CHECK => <<'END_MESSAGE';
QtQA::App::TestRunner: test failed, running again to see if it is flaky...
QtQA::App::TestRunner: test failure could be reproduced twice consecutively
END_MESSAGE

sub test_run
{
    my ($params_ref) = @_;

    my @args              = @{$params_ref->{ args }};
    my $expected_stdout   =   $params_ref->{ expected_stdout };
    my $expected_stderr   =   $params_ref->{ expected_stderr };
    my $expected_success  =   $params_ref->{ expected_success };
    my $expected_logfile  =   $params_ref->{ expected_logfile };
    my $expected_logtext  =   $params_ref->{ expected_logtext }  // "";
    my $testname          =   $params_ref->{ testname }          // q{};

    my $status;
    my ($output, $error) = capture {
        $status = system( 'perl', "$FindBin::Bin/../testrunner.pl", @args );
    };

    if ($expected_success) {
        is  ( $status, 0, "$testname exits zero" );
    }
    else {
        isnt( $status, 0, "$testname exits non-zero" );
    }

    is_or_like( $output, $expected_stdout, "$testname output looks correct" );
    is_or_like( $error,  $expected_stderr, "$testname error looks correct" );

    # The rest of the verification steps are only applicable if a log file is expected and created
    return if (!$expected_logfile);
    return if (!ok( -e $expected_logfile, "$testname created $expected_logfile" ));

    my $logtext = read_file( $expected_logfile );   # dies on error
    is_or_like( $logtext, $expected_logtext, "$testname logtext is as expected" );

    return;
}

sub test_testrunner_flaky
{
    # control; check that `--plugin flaky' has no effect if a test doesn't fail
    # flaky-mode should have no effect
    foreach my $mode_args (
        [],
        ['--flaky-mode', 'worst'],
        ['--flaky-mode', 'best'],
        ['--flaky-mode', 'ignore'],
    ) {
        test_run({
            testname         => "plugin loads OK 0 exitcode (@{ $mode_args })",
            args             => [ qw(--plugin flaky), @{ $mode_args }, qw(-- perl -e),
                                  'print STDOUT q{Hi}; print STDERR q{there!}' ],
            expected_success => 1,
            expected_stdout  => q{Hi},
            expected_stderr  => q{there!},
        });
    }

    # stable failure
    # flaky-mode should have no effect
    foreach my $mode_args (
        [],
        ['--flaky-mode', 'worst'],
        ['--flaky-mode', 'best'],
        ['--flaky-mode', 'ignore'],
    ) {
        test_run({
            testname         => "stable failure (@{ $mode_args })",
            args             => [ qw(--plugin flaky), @{ $mode_args }, qw(-- perl -e),
                                  'print qq{Failing...\n}; exit 42' ],
            expected_success => 0,
            expected_stdout  => qq{Failing...\n} x 2,    # x 2 since retried once
            expected_stderr  => $ERROR_STABLE_FAILURE,
        });
    }

    # test which fails once, then passes
    test_run({
        testname         => 'vanishing failure',
        args             => [ qw(--plugin flaky -- perl -e), $PERL_VANISHING_FAILURE ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_VANISHING_FAILURE,
        expected_stderr  => $ERROR_VANISHING_FAILURE_MODE_WORST,
    });
    test_run({
        testname         => 'vanishing failure (flaky-mode worst)',
        args             => [ qw(--plugin flaky --flaky-mode worst -- perl -e), $PERL_VANISHING_FAILURE ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_VANISHING_FAILURE,
        expected_stderr  => $ERROR_VANISHING_FAILURE_MODE_WORST,
    });
    test_run({
        testname         => 'vanishing failure (flaky-mode best)',
        args             => [ qw(--plugin flaky --flaky-mode best -- perl -e), $PERL_VANISHING_FAILURE ],
        expected_success => 1,
        expected_stdout  => $OUTPUT_VANISHING_FAILURE,
        expected_stderr  => $ERROR_VANISHING_FAILURE_MODE_BEST,
    });
    test_run({
        testname         => 'vanishing failure (flaky-mode ignore)',
        args             => [ qw(--plugin flaky --flaky-mode ignore -- perl -e), $PERL_VANISHING_FAILURE ],
        expected_success => 1,
        expected_stdout  => $OUTPUT_VANISHING_FAILURE,
        expected_stderr  => $ERROR_VANISHING_FAILURE_MODE_IGNORE,
    });


    # test which eventually fails once, then eventually passes
    # this also tests timeout warning by setting a smalltimeout value
    test_run({
        testname         => 'vanishing failure; with timeoutwarning test',
        args             => [ qw(--plugin flaky --timeout 5 -- perl -e), $PERL_VANISHING_FAILURE_TIMEOUT_WARNING ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_VANISHING_FAILURE,
        expected_stderr  => $ERROR_VANISHING_FAILURE_MODE_WORST,
    });

    # test which fails once, then again in a different way
    test_run({
        testname         => 'differing failure',
        args             => [ qw(--plugin flaky -- perl -e), $PERL_DIFFERING_FAILURE ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_DIFFERING_FAILURE,
        expected_stderr  => $ERROR_DIFFERING_FAILURE_MODE_WORST,
    });
    test_run({
        testname         => 'differing failure (flaky-mode worst)',
        args             => [ qw(--verbose --plugin flaky --flaky-mode worst -- perl -e), $PERL_DIFFERING_FAILURE ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_DIFFERING_FAILURE,
        expected_stderr  => $VERBOSE_ERROR_DIFFERING_FAILURE_MODE_WORST,
    });
    test_run({
        testname         => 'differing failure (flaky-mode best)',
        args             => [ qw(--plugin flaky --flaky-mode best -- perl -e), $PERL_DIFFERING_FAILURE ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_DIFFERING_FAILURE,
        expected_stderr  => $ERROR_DIFFERING_FAILURE_MODE_BEST,
    });
    test_run({
        testname         => 'differing failure (flaky-mode ignore)',
        args             => [ qw(--plugin flaky --flaky-mode ignore -- perl -e), $PERL_DIFFERING_FAILURE ],
        expected_success => 1,
        expected_stdout  => $OUTPUT_DIFFERING_FAILURE,
        expected_stderr  => $ERROR_DIFFERING_FAILURE_MODE_IGNORE,
    });

    # test -silent argument is omitted on second run
    test_run({
        testname         => 'silent removed',
        args             => [ qw(--plugin flaky -- perl -e), $PERL_SILENT_CHECK, '--', '-silent', '-foo' ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_SILENT_CHECK,
        expected_stderr  => $ERROR_SILENT_CHECK,
    });

    # test which hangs should be retried as usual
    test_run({
        testname         => "hanging failure",
        args             => [ qw(--timeout 2 --plugin flaky -- perl -e), $PERL_HANGING_FAILURE ],
        expected_success => 0,
        expected_stdout  => $OUTPUT_HANGING_FAILURE,
        expected_stderr  => $ERROR_HANGING_FAILURE,
    });

    my $tempdir = tempdir( basename($0).'.XXXXXX', TMPDIR => 1, CLEANUP => 1 );

    # basic check of interaction with logging
    test_run({
        testname         => 'flaky with log',
        args             => [
            '--capture-logs',
            $tempdir,
            '--plugin',
            'flaky',
            '--',
            'perl',
            '-e',
            $PERL_DIFFERING_FAILURE,
        ],
        expected_success => 0,
        expected_stdout  => q{},
        expected_stderr  => q{},
        expected_logfile => "$tempdir/perl-00.txt",
        expected_logtext => $LOG_DIFFERING_FAILURE_MODE_WORST,
    });

    # interaction with core
    # (core only works on linux)
    if ($OSNAME =~ m{linux}i) {
        test_run({
            testname         => 'flaky with tee log and core (flaky, core)',
            args             => [
                '--tee-logs',
                $tempdir,
                '--plugin',
                'flaky',
                '--flaky-mode',     # note we are testing mixing of plugin args
                'worst',            # with global testrunner args.
                '--plugin',
                'core',
                '--',
                'perl',
                '-e',
                $PERL_VANISHING_CRASH,
            ],
            expected_success => 0,
            expected_stdout  => $OUTPUT_VANISHING_CRASH,
            expected_stderr  => $ERROR_VANISHING_CRASH_WITH_FLAKY_AND_CORE,
            expected_logfile => "$tempdir/perl-01.txt",
            expected_logtext => $LOG_VANISHING_CRASH_WITH_FLAKY_AND_CORE,
        });

        # switch the order and verify that this affects the plugin order
        test_run({
            testname         => 'flaky with tee log and core (core, flaky)',
            args             => [
                '--tee-logs',
                $tempdir,
                '--plugin',
                'core',
                '--plugin',
                'flaky',
                '--',
                'perl',
                '-e',
                $PERL_VANISHING_CRASH,
            ],
            expected_success => 0,
            expected_stdout  => $OUTPUT_VANISHING_CRASH,
            expected_stderr  => $ERROR_VANISHING_CRASH_WITH_CORE_AND_FLAKY,
            expected_logfile => "$tempdir/perl-02.txt",
            expected_logtext => $LOG_VANISHING_CRASH_WITH_CORE_AND_FLAKY,
        });
    }

    return;
}

sub run
{
    test_testrunner_flaky;
    done_testing;

    return;
}

run if (!caller);
1;