add debug log to stream.go
fix test cases