From 6b46eb46e201794f2fffba9ea6e2f103a020e9a4 Mon Sep 17 00:00:00 2001
From: Philipp Heckel <pheckel@datto.com>
Date: Fri, 24 Dec 2021 00:10:22 +0100
Subject: [PATCH] A mutex in a test struct ...

---
 server/server_test.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/server_test.go b/server/server_test.go
index 3a9b20b9..9ee8f22f 100644
--- a/server/server_test.go
+++ b/server/server_test.go
@@ -11,6 +11,7 @@ import (
 	"os"
 	"path/filepath"
 	"strings"
+	"sync"
 	"testing"
 	"time"
 )
@@ -510,9 +511,12 @@ func TestServer_Curl_Publish_Poll(t *testing.T) {
 
 type testMailer struct {
 	count int
+	mu sync.Mutex
 }
 
 func (t *testMailer) Send(to string, m *message) error {
+	t.mu.Lock()
+	defer t.mu.Unlock()
 	t.count++
 	return nil
 }