Closed daveset closed 2 years ago
Thank you!
@dswarbrick do you want to review this?
The fix in frrsockets.go LGTM.
However I'm not a fan of generating the JSON for the test on the fly. That's really what test fixtures are for, i.e. include some pre-generated JSON (or even better, some actual JSON from FRR) in a testdata
directory, or as a raw string in frr_sockets_test.go. Also, whether the socket is receiving JSON or plain text is not relevant to the test.
I get your point re generating json. I wasn't sure if there was anything in our peering data I wouldn't want to expose, so I chose to generate it. As you point out it is totally arbitrary mocked data so any string longer than 4096 would trigger the issue.
I've updated to generate a random string of data of length 5000 and also slightly refactored to put the socket handling in a function used by both tests.
If you would prefer something different in terms of using testdata fixtures or the like I can do that but I can't promise when I will be able to get to it.
LGTM
Thank you, @daveset & @dswarbrick !
Fixes Issue #83