go cmd/link: 短测试还不够短

bvn4nwqk  于 6个月前  发布在  Go
关注(0)|答案(5)|浏览(43)

运行所有.bash(它执行go test -short std cmd命令),我的目标通常是单个测试应该在1秒内运行。
cmd/link测试在我系统上需要3.4秒。我们能让它运行时间更短吗?
cmd/link几乎被系统中的其他每个测试隐式地测试,所以很难相信它在-short测试中需要做很多工作。
/cc @aclements

laik7k3q

laik7k3q1#

我错过了cmd/link/internal/ld需要额外12.9秒的信息。这甚至更糟糕。

xoefb8l8

xoefb8l82#

https://golang.org/cl/125295提到了这个问题:cmd/link: skip a couple of DWARF tests in short mode

uqcuzwp8

uqcuzwp83#

在笔记本电脑的Mac系统上,大约需要1.4秒:

% go test cmd/link -v -short
=== RUN   TestDWARF
=== RUN   TestDWARF/testprog
=== RUN   TestDWARF/testprogcgo
--- PASS: TestDWARF (1.30s)
    --- PASS: TestDWARF/testprog (0.39s)
    --- PASS: TestDWARF/testprogcgo (0.78s)
=== RUN   TestDWARFiOS
--- SKIP: TestDWARFiOS (0.00s)
    dwarf_test.go:159: skipping in short mode
=== RUN   TestLargeSymName
--- PASS: TestLargeSymName (0.00s)
=== RUN   TestIssue21703
--- PASS: TestIssue21703 (0.14s)
=== RUN   TestLargeText
--- SKIP: TestLargeText (0.00s)
    linkbig_test.go:24: Skipping large text section test in short mode or on amd64
PASS
ok  	cmd/link	1.448s

我们能关闭它吗?

uqzxnwby

uqzxnwby4#

https://golang.org/cl/153258提到了这个问题:cmd/link: use SeekPC in testDWARF

0tdrvxhp

0tdrvxhp5#

https://golang.org/cl/153259提到了这个问题:cmd/link/internal/ld: run tests in parallel

相关问题