{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-xray-sdk-go/issues/39","repository_url":"https://api.github.com/repos/aws/aws-xray-sdk-go","labels_url":"https://api.github.com/repos/aws/aws-xray-sdk-go/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-xray-sdk-go/issues/39/comments","events_url":"https://api.github.com/repos/aws/aws-xray-sdk-go/issues/39/events","html_url":"https://github.com/aws/aws-xray-sdk-go/issues/39","id":292804810,"number":39,"title":"Tests have issues when running with -count=2","user":{"login":"dlsniper","id":607868,"avatar_url":"https://avatars2.githubusercontent.com/u/607868?v=4","gravatar_id":"","url":"https://api.github.com/users/dlsniper","html_url":"https://github.com/dlsniper","followers_url":"https://api.github.com/users/dlsniper/followers","following_url":"https://api.github.com/users/dlsniper/following{/other_user}","gists_url":"https://api.github.com/users/dlsniper/gists{/gist_id}","starred_url":"https://api.github.com/users/dlsniper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlsniper/subscriptions","organizations_url":"https://api.github.com/users/dlsniper/orgs","repos_url":"https://api.github.com/users/dlsniper/repos","events_url":"https://api.github.com/users/dlsniper/events{/privacy}","received_events_url":"https://api.github.com/users/dlsniper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-30T14:35:39Z","updated_at":"2018-02-01T00:43:16Z","closed_at":null,"author_association":"NONE","body":"I've noticed this while trying to fix #38 with ` master @ a53963a5ff9b8e55fe62e8f2f14afd6e40dcb627 `.\r\n\r\nWhen running with a single, default run, we get the following output:\r\n```\r\nflorin@hostname [02:26:07 PM] [~/go/src/github.com/aws/aws-xray-sdk-go] [master]\r\n-> % /usr/local/go1.9/bin/go test -count 1 ./...\r\nok      github.com/aws/aws-xray-sdk-go/header   0.003s\r\n?       github.com/aws/aws-xray-sdk-go/internal/plugins [no test files]\r\nok      github.com/aws/aws-xray-sdk-go/pattern  0.005s\r\n?       github.com/aws/aws-xray-sdk-go/plugins/beanstalk        [no test files]\r\n?       github.com/aws/aws-xray-sdk-go/plugins/ec2      [no test files]\r\n?       github.com/aws/aws-xray-sdk-go/plugins/ecs      [no test files]\r\n?       github.com/aws/aws-xray-sdk-go/resources        [no test files]\r\nok      github.com/aws/aws-xray-sdk-go/strategy/ctxmissing      0.003s\r\nok      github.com/aws/aws-xray-sdk-go/strategy/exception       0.004s\r\nok      github.com/aws/aws-xray-sdk-go/strategy/sampling        3.007s\r\nok      github.com/aws/aws-xray-sdk-go/xray     0.018s\r\n```\r\n\r\nUnfortunately, when running with ` -count=2 `, we get: \r\n\r\n```\r\nflorin@hostname [02:29:05 PM] [~/go/src/github.com/aws/aws-xray-sdk-go] [master]\r\n-> % /usr/local/go1.9/bin/go test -count 2 ./...\r\nok      github.com/aws/aws-xray-sdk-go/header   0.008s\r\n?       github.com/aws/aws-xray-sdk-go/internal/plugins [no test files]\r\nok      github.com/aws/aws-xray-sdk-go/pattern  0.010s\r\n?       github.com/aws/aws-xray-sdk-go/plugins/beanstalk        [no test files]\r\n?       github.com/aws/aws-xray-sdk-go/plugins/ec2      [no test files]\r\n?       github.com/aws/aws-xray-sdk-go/plugins/ecs      [no test files]\r\n?       github.com/aws/aws-xray-sdk-go/resources        [no test files]\r\nok      github.com/aws/aws-xray-sdk-go/strategy/ctxmissing      0.004s\r\nok      github.com/aws/aws-xray-sdk-go/strategy/exception       0.004s\r\nok      github.com/aws/aws-xray-sdk-go/strategy/sampling        6.012s\r\n1517322572747777229 [Trace] Beginning segment named Test\r\n1517322572747820004 [Trace] Beginning subsegment named TestService\r\n1517322572747827537 [Trace] Closing segment named Test\r\n1517322572747831841 [Trace] Closing subsegment named TestService\r\n1517322572748293034 [Trace] Beginning segment named Test\r\n1517322572748320807 [Trace] Beginning subsegment named TestService\r\n1517322572748342658 [Trace] Closing subsegment named TestService\r\n1517322572748346166 [Trace] Closing segment named Test\r\n1517322572748533672 [Trace] Beginning segment named Test\r\n1517322572748565291 [Trace] Beginning subsegment named ErrorService\r\n1517322572748573150 [Trace] Closing segment named Test\r\n1517322572748576019 [Trace] Closing subsegment named ErrorService\r\n1517322572748841472 [Trace] Beginning segment named Test\r\n1517322572748880384 [Trace] Beginning subsegment named PanicService\r\n1517322572748893972 [Trace] Closing subsegment named PanicService\r\n1517322572748931369 [Trace] Closing segment named Test\r\n1517322572749285148 [Trace] Beginning segment named Test\r\n1517322572749330235 [Trace] Beginning subsegment named 127.0.0.1:39155\r\n1517322572749364038 [Trace] Beginning subsegment named connect\r\n1517322572749484793 [Trace] Beginning subsegment named dial\r\n1517322572749588417 [Trace] Closing subsegment named dial\r\n1517322572749613676 [Trace] Closing subsegment named connect\r\n1517322572749621391 [Trace] Beginning subsegment named request\r\n1517322572749660596 [Trace] Closing subsegment named request\r\n1517322572749666467 [Trace] Beginning subsegment named response\r\n1517322572749829332 [Trace] Closing subsegment named response\r\n1517322572749862329 [Trace] Closing subsegment named 127.0.0.1:39155\r\n1517322572749864939 [Trace] Closing segment named Test\r\n1517322572750157995 [Trace] Beginning segment named Test\r\n1517322572750190245 [Trace] Beginning subsegment named 127.0.0.1:37699\r\n1517322572750207836 [Trace] Beginning subsegment named connect\r\n1517322572750292901 [Trace] Beginning subsegment named dial\r\n1517322572750395611 [Trace] Closing subsegment named dial\r\n1517322572750411814 [Trace] Closing subsegment named connect\r\n1517322572750415098 [Trace] Beginning subsegment named request\r\n1517322572750484792 [Trace] Closing subsegment named request\r\n1517322572750491576 [Trace] Beginning subsegment named response\r\n1517322572750598729 [Trace] Closing subsegment named response\r\n1517322572750622551 [Trace] Closing subsegment named 127.0.0.1:37699\r\n1517322572750625457 [Trace] Closing segment named Test\r\n1517322572750922561 [Trace] Beginning segment named Test\r\n1517322572750948238 [Trace] Beginning subsegment named 127.0.0.1:39569\r\n1517322572750962547 [Trace] Beginning subsegment named connect\r\n1517322572751018923 [Trace] Beginning subsegment named dial\r\n1517322572751109326 [Trace] Closing subsegment named dial\r\n1517322572751127711 [Trace] Closing subsegment named connect\r\n1517322572751130652 [Trace] Beginning subsegment named request\r\n1517322572751183265 [Trace] Closing subsegment named request\r\n1517322572751186717 [Trace] Beginning subsegment named response\r\n1517322572751261045 [Trace] Closing subsegment named response\r\n1517322572751276570 [Trace] Closing subsegment named 127.0.0.1:39569\r\n1517322572751279152 [Trace] Closing segment named Test\r\n1517322572751547112 [Trace] Beginning segment named Test\r\n1517322572751573605 [Trace] Beginning subsegment named 127.0.0.1:38477\r\n1517322572751588549 [Trace] Beginning subsegment named connect\r\n1517322572751645536 [Trace] Beginning subsegment named dial\r\n1517322572751740221 [Trace] Closing subsegment named dial\r\n1517322572751754526 [Trace] Closing subsegment named connect\r\n1517322572751757512 [Trace] Beginning subsegment named request\r\n1517322572751815691 [Trace] Closing subsegment named request\r\n1517322572751820095 [Trace] Beginning subsegment named response\r\n1517322572751908404 [Trace] Closing subsegment named response\r\n1517322572751927632 [Trace] Closing subsegment named 127.0.0.1:38477\r\n1517322572751930276 [Trace] Closing segment named Test\r\n1517322572752192115 [Trace] Beginning segment named Test\r\n1517322572752220216 [Trace] Beginning subsegment named localhost:8000\r\n1517322572752234352 [Trace] Closing subsegment named localhost:8000\r\n1517322572752274765 [Trace] Closing segment named Test\r\n--- FAIL: TestDefaultConfigureParameters (0.00s)\r\n        Error Trace:    config_test.go:113\r\n        Error:          Not equal: \r\n                        expected: &sampling.LocalizedStrategy{manifest:(*sampling.RuleManifest)(0xc4201b86c0)}\r\n                        actual  : &sampling.LocalizedStrategy{manifest:(*sampling.RuleManifest)(0xc4203a6840)}\r\n                    \r\n                        Diff:\r\n                        --- Expected\r\n                        +++ Actual\r\n                        @@ -10,3 +10,3 @@\r\n                            reservoir: (*sampling.Reservoir)({\r\n                        -    maskedCounter: (uint64) 0,\r\n                        +    maskedCounter: (uint64) 151732257200000001,\r\n                             perSecond: (uint64) 1,\r\n        Test:           TestDefaultConfigureParameters\r\n        Error Trace:    config_test.go:115\r\n        Error:          Not equal: \r\n                        expected: \"\"\r\n                        actual  : \"TestVersion\"\r\n        Test:           TestDefaultConfigureParameters\r\n--- FAIL: TestSQL (0.00s)\r\n    --- FAIL: TestSQL/TestPasswordConnectionString (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:166\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: user=user password=password database=database\r\n        Test:           TestSQL/TestPasswordConnectionString\r\n    --- FAIL: TestSQL/TestPasswordURL (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:96\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: postgres://user:password@host:port/database\r\n        Test:           TestSQL/TestPasswordURL\r\n    --- FAIL: TestSQL/TestPasswordURLQuery (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:106\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: postgres://host:port/database?password=password\r\n        Test:           TestSQL/TestPasswordURLQuery\r\n    --- FAIL: TestSQL/TestPasswordURLSchemaless (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:116\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: user:password@host:port/database\r\n        Test:           TestSQL/TestPasswordURLSchemaless\r\n    --- FAIL: TestSQL/TestPasswordURLSchemalessUserlessQuery (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:126\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: host:port/database?password=password\r\n        Test:           TestSQL/TestPasswordURLSchemalessUserlessQuery\r\n    --- FAIL: TestSQL/TestPasswordlessConnectionString (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:156\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: user=user database=database\r\n        Test:           TestSQL/TestPasswordlessConnectionString\r\n    --- FAIL: TestSQL/TestPasswordlessURL (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:86\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: postgres://user@host:port/database\r\n        Test:           TestSQL/TestPasswordlessURL\r\n    --- FAIL: TestSQL/TestSemicolonPasswordConnectionString (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:176\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: odbc:server=localhost;user id=sa;password={foo}};bar};otherthing=thing\r\n        Test:           TestSQL/TestSemicolonPasswordConnectionString\r\n    --- FAIL: TestSQL/TestWeirdPasswordURL (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:136\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: user%2Fpassword@host:port/database\r\n        Test:           TestSQL/TestWeirdPasswordURL\r\n    --- FAIL: TestSQL/TestWeirderPasswordURL (0.00s)\r\n        Error Trace:    sql_test.go:49\r\n                        sql_test.go:146\r\n        Error:          Received unexpected error:\r\n                        cannot create a new mock database with the same dsn: user/password@host:port/database\r\n        Test:           TestSQL/TestWeirderPasswordURL\r\nFAIL\r\nFAIL    github.com/aws/aws-xray-sdk-go/xray     0.031s\r\n```\r\n\r\nThis makes me think that the tests are not very well isolated from each-other which makes it hard to reliably test changes, like the one I have for #38. I'll try and have a look at this but unfortunately I don't have too much time to spend on this right now."},"comment":{"url":"https://api.github.com/repos/aws/aws-xray-sdk-go/issues/comments/362120099","html_url":"https://github.com/aws/aws-xray-sdk-go/issues/39#issuecomment-362120099","issue_url":"https://api.github.com/repos/aws/aws-xray-sdk-go/issues/39","id":362120099,"user":{"login":"luluzhao","id":12831515,"avatar_url":"https://avatars3.githubusercontent.com/u/12831515?v=4","gravatar_id":"","url":"https://api.github.com/users/luluzhao","html_url":"https://github.com/luluzhao","followers_url":"https://api.github.com/users/luluzhao/followers","following_url":"https://api.github.com/users/luluzhao/following{/other_user}","gists_url":"https://api.github.com/users/luluzhao/gists{/gist_id}","starred_url":"https://api.github.com/users/luluzhao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luluzhao/subscriptions","organizations_url":"https://api.github.com/users/luluzhao/orgs","repos_url":"https://api.github.com/users/luluzhao/repos","events_url":"https://api.github.com/users/luluzhao/events{/privacy}","received_events_url":"https://api.github.com/users/luluzhao/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T00:43:16Z","updated_at":"2018-02-01T00:43:16Z","author_association":"CONTRIBUTOR","body":"@dlsniper , thank you for pointing out this issue. We are working on it right now. Will get back to you we the fix is ready."}}
{"actor":{"display_login":"luluzhao"}}