File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 7
7
"net"
8
8
"os"
9
9
"path/filepath"
10
+ "sync"
10
11
"testing"
11
12
"testing/fstest"
12
13
"time"
@@ -142,11 +143,14 @@ func TestMain(m *testing.M) {
142
143
}
143
144
fbcServerDeprecations := server (fbcDeprecationStore )
144
145
146
+ var wg sync.WaitGroup
147
+ wg .Add (3 )
145
148
go func () {
146
149
lis , err := net .Listen ("tcp" , dbPort )
147
150
if err != nil {
148
151
logrus .Fatalf ("failed to listen: %v" , err )
149
152
}
153
+ wg .Done ()
150
154
if err := grpcServer .Serve (lis ); err != nil {
151
155
logrus .Fatalf ("failed to serve db: %v" , err )
152
156
}
@@ -156,6 +160,7 @@ func TestMain(m *testing.M) {
156
160
if err != nil {
157
161
logrus .Fatalf ("failed to listen: %v" , err )
158
162
}
163
+ wg .Done ()
159
164
if err := fbcServerSimple .Serve (lis ); err != nil {
160
165
logrus .Fatalf ("failed to serve fbc cache: %v" , err )
161
166
}
@@ -165,10 +170,12 @@ func TestMain(m *testing.M) {
165
170
if err != nil {
166
171
logrus .Fatalf ("failed to listen: %v" , err )
167
172
}
173
+ wg .Done ()
168
174
if err := fbcServerDeprecations .Serve (lis ); err != nil {
169
175
logrus .Fatalf ("failed to serve fbc cache: %v" , err )
170
176
}
171
177
}()
178
+ wg .Wait ()
172
179
exit := m .Run ()
173
180
os .Exit (exit )
174
181
}
You can’t perform that action at this time.
0 commit comments