(Unexpected) Lag from Timers in Go
frew.co
frew.co
Also, time.Sleep in a test wouldn't pass code review. A better approach is to timestamp incoming lines and merge them based on that alone. That is testable, although the overall concept is still a bit unsound.