@cryptotaxi247 / kubo / commits / a4115e9e1

Extract go-detect-race from Godeps

I have forked it, put it under ipfs namespace, published to gx License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>

Hector Sanjuan committed Feb 12, 2018 at 12:35 UTC a4115e9e14083ddd7c5c2953f86186a2fa832691
9 files changed +7 -86
Godeps/Godeps.json
-4
@@ -29,10 +29,6 @@
29 "ImportPath": "github.com/hashicorp/golang-lru",
30 "Rev": "253b2dc1ca8bae42c3b5b6e53dd2eab1a7551116"
31 },
32 - {
33 - "ImportPath": "github.com/jbenet/go-detect-race",
34 - "Rev": "3463798d9574bd0b7eca275dccc530804ff5216f"
35 - },
32 {
33 "ImportPath": "github.com/jbenet/go-os-rename",
34 "Rev": "3ac97f61ef67a6b87b95c1282f6c317ed0e693c2"
Godeps/_workspace/src/github.com/jbenet/go-detect-race/LICENSE deleted
-21
@@ -1,21 +0,0 @@
1 -The MIT License (MIT)
2 -
3 -Copyright (c) 2014 Juan Batiz-Benet
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy
6 -of this software and associated documentation files (the "Software"), to deal
7 -in the Software without restriction, including without limitation the rights
8 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 -copies of the Software, and to permit persons to whom the Software is
10 -furnished to do so, subject to the following conditions:
11 -
12 -The above copyright notice and this permission notice shall be included in
13 -all copies or substantial portions of the Software.
14 -
15 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 -THE SOFTWARE.
Godeps/_workspace/src/github.com/jbenet/go-detect-race/README.md deleted
-33
@@ -1,33 +0,0 @@
1 -# go-detect-race
2 -
3 -Check if the race detector is running.
4 -
5 -I didnt find a variable to check quickly enough so I made this.
6 -
7 -
8 -## Usage
9 -
10 -```go
11 -import (
12 - detectrace "github.com/jbenet/go-detect-race"
13 -)
14 -
15 -func main() {
16 - if detectrace.WithRace() {
17 - // running with -race
18 - } else {
19 - // running without -race
20 - }
21 -}
22 -```
23 -
24 -## Why?
25 -
26 -Because the race detector doesnt like massive stress tests. Example:
27 -https://groups.google.com/forum/#!topic/golang-nuts/XDPHUt2LE70
28 -
29 -## Why didn't you just use...
30 -
31 -Please tell me about a better way of doing this. It wasn't
32 -readily apparent to me, so I made this. But i would much prefer
33 -an env var or some already existing var from the stdlib :)
Godeps/_workspace/src/github.com/jbenet/go-detect-race/race.go deleted
-7
@@ -1,7 +0,0 @@
1 -package detectrace
2 -
3 -// WithRace returns whether the binary was compiled
4 -// with the race flag on.
5 -func WithRace() bool {
6 - return withRace
7 -}
Godeps/_workspace/src/github.com/jbenet/go-detect-race/race_test.go deleted
-9
@@ -1,9 +0,0 @@
1 -package detectrace
2 -
3 -import (
4 - "testing"
5 -)
6 -
7 -func TestWithRace(t *testing.T) {
8 - t.Logf("WithRace() is %v\n", WithRace())
9 -}
Godeps/_workspace/src/github.com/jbenet/go-detect-race/withoutrace.go deleted
-5
@@ -1,5 +0,0 @@
1 -// +build !race
2 -
3 -package detectrace
4 -
5 -const withRace = false
Godeps/_workspace/src/github.com/jbenet/go-detect-race/withrace.go deleted
-5
@@ -1,5 +0,0 @@
1 -// +build race
2 -
3 -package detectrace
4 -
5 -const withRace = true
exchange/bitswap/bitswap_test.go
+1 -2
@@ -15,13 +15,12 @@ import (
15 mockrouting "github.com/ipfs/go-ipfs/routing/mock"
16 delay "github.com/ipfs/go-ipfs/thirdparty/delay"
17
18 - detectrace "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race"
19 -
18 tu "gx/ipfs/QmVvkK7s5imCiq3JVbL3pGfnhcCnf3LrFJPF4GE2sAoGZf/go-testutil"
19 travis "gx/ipfs/QmVvkK7s5imCiq3JVbL3pGfnhcCnf3LrFJPF4GE2sAoGZf/go-testutil/ci/travis"
20 p2ptestutil "gx/ipfs/QmYVR3C8DWPHdHxvLtNFYfjsXgaRAdh6hPMNH3KiwCgu4o/go-libp2p-netutil"
21 cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
22 blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format"
23 + detectrace "gx/ipfs/Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF/go-detect-race"
24 )
25
26 // FIXME the tests are really sensitive to the network delay. fix them to work
package.json
+6
@@ -527,6 +527,12 @@
527 "hash": "QmWo8jYc19ppG7YoTsrr2kEtLRbARTJho5oNXFTR6B7Peq",
528 "name": "go-ipfs-chunker",
529 "version": "0.0.2"
530 + },
531 + {
532 + "author": "jbenet",
533 + "hash": "Qmf7HqcW7LtCi1W8y2bdx2eJpze74jkbKqpByxgXikdbLF",
534 + "name": "go-detect-race",
535 + "version": "1.0.1"
536 }
537 ],
538 "gxVersion": "0.10.0",