-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af6bc1d
commit 8dfe1f8
Showing
20 changed files
with
537 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
# rebuilds are for developing this script | ||
if [ x$1 = xrebuild ] | ||
then | ||
find . -name 'vet.log*' | xargs /bin/rm | ||
fi | ||
|
||
out=0 | ||
# find directories with go source files | ||
for e in `find . -name '*.go' |sed -e 's,/[^/]*$,,'|sort -u` | ||
do | ||
( | ||
d=`echo $e | sed -e 's,^..,,'` | ||
cd $d | ||
go vet -c=3 github.com/paypal/hera/$d 2> vet.log3 | ||
rv=$? | ||
if [ $rv -ne 0 ] | ||
then | ||
# remove line numbers | ||
sed -e 's/^[0-9]*//;s/[.]go:[0-9]*:[0-9]*: /.go /' vet.log3 > vet.log2 | ||
|
||
# save the go vet output if we are rebuilding | ||
if [ x$1 = xrebuild -a ! -e vet.log ] | ||
then | ||
cp vet.log{2,} | ||
fi | ||
|
||
# diff go vet output against dev commit vet.log | ||
if [ ! -e vet.log ] | ||
then | ||
cat vet.log2 | ||
rvd=2 | ||
else | ||
diff vet.log{,2} | ||
rvd=$? | ||
fi | ||
if [ $rvd -ne 0 ] | ||
then | ||
echo $rvd rv-vet-diff $d | ||
exit $rvd | ||
fi | ||
fi | ||
) | ||
subRv=$? | ||
if [ $subRv -ne 0 ] | ||
then | ||
out=$subRv | ||
fi | ||
done | ||
|
||
if [ x$1 = xrebuild ] | ||
then | ||
time ./govet.sh | ||
out=$? | ||
echo `date` "second pass complete for rebuild" | ||
fi | ||
|
||
echo $out overall go vet rv | ||
exit $out |
33 changes: 33 additions & 0 deletions
33
tests/functionaltest/bind_eviction_tests/inclause_evict/vet.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# github.com/paypal/hera/tests/functionaltest/bind_eviction_tests/inclause_evict | ||
./main_test_disable.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
./main_test_disable.go this return statement may be reached without using the cancel var defined on line 66 | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
defer conn.Close() | ||
defer cancel() | ||
./main_test_disable.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
./main_test_disable.go this return statement may be reached without using the cancel var defined on line 107 | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
defer conn.Close() | ||
defer cancel() |
33 changes: 33 additions & 0 deletions
33
tests/functionaltest/bind_eviction_tests/simple_evict/vet.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# github.com/paypal/hera/tests/functionaltest/bind_eviction_tests/simple_evict | ||
./main_test_disable.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
./main_test_disable.go this return statement may be reached without using the cancel var defined on line 66 | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
defer conn.Close() | ||
./main_test_disable.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
./main_test_disable.go this return statement may be reached without using the cancel var defined on line 112 | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
defer conn.Close() | ||
// cancel must be called before conn.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# github.com/paypal/hera/tests/functionaltest/bind_eviction_tests/util | ||
./dbops.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
./dbops.go this return statement may be reached without using the cancel var defined on line 37 | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
defer conn.Close() | ||
defer cancel() | ||
./dbops.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
./dbops.go this return statement may be reached without using the cancel var defined on line 84 | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
defer conn.Close() | ||
defer cancel() | ||
./dbops.go the cancel function is not used on all paths (possible context leak) | ||
db.SetMaxIdleConns(0) | ||
defer db.Close() | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
fmt.Println("Error creating context:", err) | ||
./dbops.go this return statement may be reached without using the cancel var defined on line 139 | ||
conn, err := db.Conn(ctx) | ||
if err != nil { | ||
fmt.Println("Error creating context:", err) | ||
return count | ||
} | ||
defer conn.Close() | ||
defer cancel() |
Oops, something went wrong.