Skip to content

Commit

Permalink
fix: add timeout to the test (#618)
Browse files Browse the repository at this point in the history
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: jyu6 <[email protected]>
Co-authored-by: Yashash H L <[email protected]>
Co-authored-by: jyu6 <[email protected]>
  • Loading branch information
3 people authored and whynowy committed Apr 3, 2023
1 parent b049f0b commit 0ca5630
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dist/$(BINARY_NAME)-%:

.PHONY: test
test:
go test $(shell go list ./... | grep -v /vendor/ | grep -v /numaflow/test/) -race -short -v
go test $(shell go list ./... | grep -v /vendor/ | grep -v /numaflow/test/) -race -short -v -timeout 60s

.PHONY: test-coverage
test-coverage:
Expand All @@ -100,7 +100,7 @@ test-coverage-with-isb:

.PHONY: test-code
test-code:
go test -tags=isb_redis -race -v $(shell go list ./... | grep -v /vendor/ | grep -v /numaflow/test/)
go test -tags=isb_redis -race -v $(shell go list ./... | grep -v /vendor/ | grep -v /numaflow/test/) -timeout 120s

test-e2e:
test-kafka-e2e:
Expand Down
3 changes: 3 additions & 0 deletions pkg/isb/stores/simplebuffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func (b *InMemoryBuffer) Read(ctx context.Context, count int64) ([]*isb.ReadMess
if errors.Is(err, context.Canceled) {
return readMessages, nil
}
if errors.Is(err, context.DeadlineExceeded) {
return readMessages, nil
}
return readMessages, isb.BufferReadErr{Name: b.name, Empty: true, Message: err.Error()}
}
// access buffer via lock
Expand Down

0 comments on commit 0ca5630

Please sign in to comment.