testhelper: Fix race condition on test logger buf
Currently we supply a bare bytes.Buffer
to logrus for use as output.
When a test fails, we read the contents of the buffer, but do so without
synchronization with logrus's goroutines, causing race detector failures.
Add a new syncBuffer
struct to synchronize access. For now keep this
private to testhelper
until we see other uses for it.
Edited by Will Chandler (ex-GitLab)