Use buffered channels to avoid goroutines in tests