Page MenuHomePhabricator

Add support for the race detector in the parser
AbandonedPublic

Authored by eMxyzptlk on Apr 25 2015, 6:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 12:03 AM
Unknown Object (File)
Thu, Apr 11, 8:21 AM
Unknown Object (File)
Mon, Apr 8, 9:11 AM
Unknown Object (File)
Fri, Mar 29, 11:00 PM
Unknown Object (File)
Mar 18 2024, 1:43 PM
Unknown Object (File)
Mar 18 2024, 11:06 AM
Unknown Object (File)
Mar 5 2024, 5:41 PM
Unknown Object (File)
Feb 21 2024, 2:26 PM

Details

Reviewers
None
Group Reviewers
Blessed Reviewers
Maniphest Tasks
T6867: Add linter and unit test engine for Go(lang)
Summary

Go test support race detection via the -race flag, this Diffusion enhance the
Go test result parser to correctly parse the race detection.

Test Plan

Unit test

Diff Detail

Event Timeline

eMxyzptlk retitled this revision from to Add support for the race detector in the parser.
eMxyzptlk updated this object.
eMxyzptlk edited the test plan for this revision. (Show Details)
eMxyzptlk added a reviewer: Blessed Reviewers.
eMxyzptlk added a subscriber: ox.
eMxyzptlk edited edge metadata.
  • consider the race condition a failure by itself regardless of the actual testing

Go test is sending the output of the racer to STDERR while sending the rest to STDOUT, so the format seen by exec_manual is not the same as seen on the terminal.

wmn@cratos /tmp/test_arc [master *] ± % go test -race -v ./ > /dev/null
==================
WARNING: DATA RACE
Write by goroutine 7:
  _/tmp/test_arc.func·002()
      /tmp/test_arc/arc_test.go:13 +0x3a

Previous write by goroutine 6:
  _/tmp/test_arc.func·001()
      /tmp/test_arc/arc_test.go:9 +0x3a

Goroutine 7 (running) created at:
  _/tmp/test_arc.TestShouldNotPassRaceTest()
      /tmp/test_arc/arc_test.go:14 +0x133
  testing.tRunner()
      /usr/local/Cellar/go/1.4.2/libexec/src/testing/testing.go:447 +0x133

Goroutine 6 (finished) created at:
  _/tmp/test_arc.TestShouldNotPassRaceTest()
      /tmp/test_arc/arc_test.go:10 +0xc0
  testing.tRunner()
      /usr/local/Cellar/go/1.4.2/libexec/src/testing/testing.go:447 +0x133
==================
wmn@cratos /tmp/test_arc [master *] ± % go test -race -v ./ 2> /dev/null
=== RUN TestShouldNotPassRaceTest
--- PASS: TestShouldNotPassRaceTest (0.00s)
PASS
ok      _/tmp/test_arc  0.009s
  • The race warning lives in STDERR so parse it assuming it comes first
  • The race warning lives in STDERR so parse it assuming it comes first