TAP parsing + Buffered subtests seems to have a flaw

Open
#216 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
perl
Domain
testing-qa

Research direction

Start by running the reproduction in demo/tap/tap.t and tracing how TAP parsing handles buffered subtests and their event log entries. The fix is complete when the buffered subtest is displayed once and its nested events appear once in both the output and event log.

Written by the indexing model from the issue text.

Description

# HARNESS-NO-STREAM
use Test2::V0;
use Test2::Tools::Subtest qw/subtest_streamed subtest_buffered/;

ok(1, "An ok");
diag "A Diag";
note "A Note";

subtest_streamed streamed => sub {
    ok(1, "streamed ok");
};

subtest_buffered buffered => sub {
    ok(1, "buffered ok");
};

done_testing;
( LAUNCH )  job  1    demo/tap/tap.t
(  NOTE  )  job  1    Seeded srand with seed '20210309' from local date.
[  PASS  ]  job  1  + An ok
(  NOTE  )  job  1    A Note
(  NOTE  )  job  1    Subtest: streamed
[  PASS  ]  job  1  +~Subtest: streamed
[  PASS  ]  job  1    + streamed ok
[  PLAN  ]  job  1    | Expected assertions: 1
            job  1    ^
[  PASS  ]  job  1  +~buffered
[  PASS  ]  job  1  +~buffered
[  PLAN  ]  job  1    Expected assertions: 3
(  NOTE  )  job  1    rss:  22732kB
(  NOTE  )  job  1    size: 31124kB
(  NOTE  )  job  1    peak: 31124kB
(  DIAG  )  job  1    A Diag
( PASSED )  job  1    demo/tap/tap.t
(  TIME  )  job  1    Startup: 0.01399s | Events: 0.00000s | Cleanup: 0.02992s | Total: 0.04391s

Notice that 'buffered' is displayed twice, and the nested events are not seen. The event log also has 'buffered' twice.

Dominant language
Perl
Stars
28
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Test-More/Test2-Harness

All issues in Test-More/Test2-Harness

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.