Admin tests are no longer parallel as module loading interferes with other test results. ForwardCommand test now retries until all values are found in a quorum or a 5 second limit is reached.

This commit is contained in:
Kelvin Clement Mwinuka
2024-05-31 18:55:50 +08:00
parent b48ee54228
commit 5de2cc8a53
4 changed files with 509 additions and 509 deletions

View File

@@ -16,15 +16,12 @@ package connection_test
import (
"errors"
"fmt"
"github.com/echovault/echovault/echovault"
"github.com/echovault/echovault/internal"
"github.com/echovault/echovault/internal/config"
"github.com/echovault/echovault/internal/constants"
"github.com/tidwall/resp"
"net"
"strings"
"sync"
"testing"
)
@@ -48,20 +45,16 @@ func Test_Connection(t *testing.T) {
return
}
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
wg.Done()
mockServer.Start()
}()
wg.Wait()
t.Cleanup(func() {
mockServer.ShutDown()
})
t.Run("Test_HandlePing", func(t *testing.T) {
conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", port))
conn, err := internal.GetConnection("localhost", port)
if err != nil {
t.Error(err)
return