Skip to content

Commit

Permalink
fix: update failed bitswap event to failed retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehuntsman committed Jun 27, 2023
1 parent 2879b02 commit d4f9193
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/retriever/bitswapretriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (br *bitswapRetrieval) RetrieveFromAsyncCandidates(ayncCandidates types.Inb
br.bstore.RemoveLinkSystem(br.request.RetrievalID)
if err != nil {
// record failure
br.events(events.Failed(br.clock.Now(), br.request.RetrievalID, bitswapCandidate, err.Error()))
br.events(events.FailedRetrieval(br.clock.Now(), br.request.RetrievalID, bitswapCandidate, err.Error()))
return nil, err
}
duration := br.clock.Since(startTime)
Expand Down
12 changes: 6 additions & 6 deletions pkg/retriever/bitswapretriever_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ func TestBitswapRetriever(t *testing.T) {
cid2: testutil.GenerateRetrievalCandidates(t, 7),
},
expectedEvents: map[cid.Cid][]types.EventCode{
cid1: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedCode},
cid2: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedCode},
cid1: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedRetrievalCode},
cid2: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedRetrievalCode},
},
expectedErrors: map[cid.Cid]struct{}{
cid1: {},
Expand All @@ -232,8 +232,8 @@ func TestBitswapRetriever(t *testing.T) {
cid2: testutil.GenerateRetrievalCandidates(t, 7),
},
expectedEvents: map[cid.Cid][]types.EventCode{
cid1: {types.StartedRetrievalCode, types.FailedCode},
cid2: {types.StartedRetrievalCode, types.FailedCode},
cid1: {types.StartedRetrievalCode, types.FailedRetrievalCode},
cid2: {types.StartedRetrievalCode, types.FailedRetrievalCode},
},
expectedErrors: map[cid.Cid]struct{}{
cid1: {},
Expand Down Expand Up @@ -261,8 +261,8 @@ func TestBitswapRetriever(t *testing.T) {
cid2: testutil.GenerateRetrievalCandidates(t, 7),
},
expectedEvents: map[cid.Cid][]types.EventCode{
cid1: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedCode},
cid2: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedCode},
cid1: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedRetrievalCode},
cid2: {types.StartedRetrievalCode, types.FirstByteCode, types.FailedRetrievalCode},
},
expectedErrors: map[cid.Cid]struct{}{
cid1: {},
Expand Down

0 comments on commit d4f9193

Please sign in to comment.