Skip to content

Test output not parsed well in Parallel #114

Closed
@ialcor-zz

Description

@ialcor-zz

When many tests are launched in parallel the output of the test is lost most of the time. In fact it's assigned to the wrong test.

The parser iterates over every line of the Go test output, matching them against some regex to parse different info. The parsed info is assigned to the current test.

Current test (var cur string) is dynamically changed when lines containing === RUN {testName} or === CONT {testName} are found.

Example:

=== RUN   TestListAccessRight/list_wildcard
--- PASS: TestGetAccessRight (0.02s)
--- PASS: TestDeleteAccessRight (0.02s)
=== RUN   TestListAccessRight/list_wildcard_filter
=== RUN   TestCreateCardKey/update_mask_uid
--- PASS: TestListUser (0.03s)
    TestUpdateUser/update_mask_nil: user_test.go:330:
         got: name:"xxx/yyy/users/hope-clayton" first_name:"Jane" last_name:"Doe" display_name:"Jane Doe" email:"jane.doe@was.found" activate_time:{seconds:1596380613 nanos:316546000} expire_time:{seconds:1596380613 nanos:316546000}
         want: name:"xxx/zzz/users/hope-clayton" first_name:"Jane" last_name:"Doe" display_name:"Jane Doe" email:"jane.doe@was.found" activate_time:{seconds:1596380613 nanos:316546000} expire_time:{seconds:1596380613 nanos:316546000}
=== RUN   TestUpdateUser/update_mask_empty
--- PASS: TestCancelCardKey (0.02s)
=== RUN   TestUpdateCardKey/update_mask_nil
=== RUN   TestCreateCardKey/update_mask_empty
    TestUpdateUser/update_mask_empty: user_test.go:330:
         got: name:"xxx/yyy/users/hope-clayton" first_name:"Jane" last_name:"Doe" display_name:"Jane Doe" email:"jane.doe@was.found" activate_time:{seconds:1596380613 nanos:316546000} expire_time:{seconds:1596380613 nanos:316546000}
         want: name:"xxx/zzz/users/hope-clayton" first_name:"Jane" last_name:"Doe" display_name:"Jane Doe" email:"jane.doe@was.found" activate_time:{seconds:1596380613 nanos:316546000} expire_time:{seconds:1596380613 nanos:316546000}
=== RUN   TestUpdateUser/update_mask_paths_empty
=== RUN   TestUpdateCardKey/update_mask_empty

In the above example, you can see that output from TestUpdateUser/update_mask_nil is just after === RUN TestCreateCardKey/update_mask_empty and thus the output is assigned to that test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions