Skip to content

Commit

Permalink
Remove unnecessary concurrency from test
Browse files Browse the repository at this point in the history
  • Loading branch information
diegobernardes committed Dec 23, 2023
1 parent 4ec0dff commit bdb495a
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"context"
"os"
"strconv"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -40,22 +39,16 @@ func TestClientIntegration(t *testing.T) {
require.NoError(t, err)
require.Equal(t, ctraderAccountID, int(*r2.CtidTraderAccountId))

var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
reqSymbolList := &openapi.ProtoOASymbolsListReq{
CtidTraderAccountId: lo.ToPtr(int64(ctraderAccountID)),
}
respSymbolList, errSymbolList := Command[*openapi.ProtoOASymbolsListReq, *openapi.ProtoOASymbolsListRes](
context.Background(), c, reqSymbolList,
)
require.NoError(t, errSymbolList)
_, ok := lo.Find(respSymbolList.Symbol, func(s *openapi.ProtoOALightSymbol) bool {
return *s.SymbolName == "EURUSD"
})
require.True(t, ok)
}()
wg.Wait()
reqSymbolList := &openapi.ProtoOASymbolsListReq{
CtidTraderAccountId: lo.ToPtr(int64(ctraderAccountID)),
}
respSymbolList, errSymbolList := Command[*openapi.ProtoOASymbolsListReq, *openapi.ProtoOASymbolsListRes](
context.Background(), c, reqSymbolList,
)
require.NoError(t, errSymbolList)
_, ok := lo.Find(respSymbolList.Symbol, func(s *openapi.ProtoOALightSymbol) bool {
return *s.SymbolName == "EURUSD"
})
require.True(t, ok)
require.NoError(t, c.Stop())
}

0 comments on commit bdb495a

Please sign in to comment.