go-chrome icon indicating copy to clipboard operation
go-chrome copied to clipboard

Data racing

Open canhlinh opened this issue 6 years ago • 3 comments

When i run go test -v -race with socket package I got a lot of data race error messages

Could you please fix this issue ?

canhlinh avatar Aug 29 '18 14:08 canhlinh

Hi @canhlinh, thanks for the report,

This is a known issue but since it's come up for you I'll take another look. The issue comes from mocking the socket to test the channels the API returns. It probably makes sense to separate that out but I'm not sure what the best approach is. I'm open to any ideas.

mkenney avatar Aug 29 '18 23:08 mkenney

@mkenney Never mind. I've not much time but I can help you fix this bug on the socket package only.

canhlinh avatar Aug 30 '18 03:08 canhlinh

I think this tiny standalone lib might give you some ideas about how to design the WebSocket protocol without racing problem: https://github.com/go-rod/rod/tree/master/lib/cdp

Since it's standalone, you can directly use it in your lib.

Also, I think the lib that uses it is worth to check: https://github.com/go-rod/rod

ysmood avatar Jul 15 '20 17:07 ysmood