Unverified Commit 444faec0 authored by Hannah Howard's avatar Hannah Howard Committed by GitHub

Merge pull request #34 from ipfs/feat/add-travis

ci(travis): add travis.yml
parents ec235713 f07e2e65
os:
- linux
language: go
go:
- 1.11.x
env:
global:
- GOTFLAGS="-race"
matrix:
- BUILD_DEPTYPE=gomod
# disable travis install
install:
- true
script:
- bash <(curl -s https://raw.githubusercontent.com/ipfs/ci-helpers/master/travis-ci/run-standard-tests.sh)
cache:
directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod
- $HOME/.cache/go-build
notifications:
email: false
......@@ -14,8 +14,8 @@ import (
"github.com/ipfs/go-graphsync/requestmanager"
"github.com/ipfs/go-graphsync/responsemanager"
"github.com/ipfs/go-graphsync/responsemanager/peerresponsemanager"
"github.com/ipfs/go-peertaskqueue"
logging "github.com/ipfs/go-log"
"github.com/ipfs/go-peertaskqueue"
ipld "github.com/ipld/go-ipld-prime"
"github.com/libp2p/go-libp2p-peer"
)
......
......@@ -12,9 +12,9 @@ import (
cid "github.com/ipfs/go-cid"
gsmsg "github.com/ipfs/go-graphsync/message"
"github.com/ipfs/go-graphsync/responsemanager/peerresponsemanager"
"github.com/ipfs/go-peertaskqueue/peertask"
"github.com/ipfs/go-graphsync/testbridge"
"github.com/ipfs/go-graphsync/testutil"
"github.com/ipfs/go-peertaskqueue/peertask"
ipld "github.com/ipld/go-ipld-prime"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
peer "github.com/libp2p/go-libp2p-peer"
......@@ -222,9 +222,18 @@ func TestCancellationQueryInProgress(t *testing.T) {
responseManager.synchronize()
// read one block -- to unblock processing
// at this point we should receive at most one more block, then traversal
// should complete
additionalMessageCount := 0
drainqueue:
for {
select {
case <-ctx.Done():
t.Fatal("Should have completed request but didn't")
case sentResponse := <-sentResponses:
if additionalMessageCount > 0 {
t.Fatal("should not send any more responses")
}
k := sentResponse.link.(cidlink.Link)
blockIndex := testutil.IndexOf(blks, k.Cid)
if blockIndex == -1 {
......@@ -236,17 +245,10 @@ func TestCancellationQueryInProgress(t *testing.T) {
if sentResponse.requestID != requestID {
t.Fatal("incorrect response id")
}
case <-ctx.Done():
t.Fatal("did not send responses")
}
// at this point traversal should abort and we should receive a completion
select {
case <-ctx.Done():
t.Fatal("Should have completed request but didn't")
case <-sentResponses:
t.Fatal("should not send any more responses")
additionalMessageCount++
case <-requestIDChan:
break drainqueue
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment