How to skip unit test when benchmark in Go 1.1?

534 views
Skip to first unread message

dlin

unread,
May 16, 2013, 6:45:49 AM5/16/13
to golan...@googlegroups.com
I use make file to run

go test -race        // it tooks long time
go test -bench .  // I wish it run only  benchmark, but failed. 

(google solution was -flag xxx_test.go, but after Go 1.0.3, it can not work)

BTW, another problem of running benchmark testing is:

I'm trying to benchmark how fast my clients can connect to server?

If the connection count (B.N) range in about 200, it will work. (system limited).
So, -benchtime 0.1s  // workable
But default  -benchtime 1s   will failed, because it will try to open too much file handles.
I think it is proper to add a benchmark flag (-test.benchMaxN to limit the B.N valid range)

Dmitry Vyukov

unread,
May 16, 2013, 6:47:11 AM5/16/13
to dlin, golang-nuts
go test -run=nonthingplease -bench=.*
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

dlin

unread,
May 16, 2013, 7:17:11 AM5/16/13
to golan...@googlegroups.com, dlin
Nice trick, thanks.
Reply all
Reply to author
Forward
0 new messages