mirror of https://github.com/status-im/consul.git
gofmt
This commit is contained in:
parent
0119ec7f0a
commit
14be60aaca
|
@ -1,15 +1,15 @@
|
|||
package agent
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/serf/serf"
|
||||
"net/http"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
"errors"
|
||||
)
|
||||
|
||||
func TestHTTPAgentServices(t *testing.T) {
|
||||
|
|
|
@ -2,8 +2,8 @@ package agent
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
|
@ -174,7 +174,7 @@ func TestCatalogNodes_Blocking(t *testing.T) {
|
|||
}
|
||||
|
||||
// Should block for a while
|
||||
if time.Now().Sub(start) < 50 * time.Millisecond {
|
||||
if time.Now().Sub(start) < 50*time.Millisecond {
|
||||
// TODO: Failing
|
||||
t.Fatalf("too fast")
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package agent
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/miekg/dns"
|
||||
"os"
|
||||
"strings"
|
||||
|
|
|
@ -2,8 +2,8 @@ package agent
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
|
|
|
@ -3,8 +3,8 @@ package agent
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package agent
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package agent
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/serf/serf"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/serf/serf"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package agent
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"os"
|
||||
"testing"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
)
|
||||
|
||||
func TestStatusLeader(t *testing.T) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package agent
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package command
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/serf/serf"
|
||||
"github.com/mitchellh/cli"
|
||||
"strings"
|
||||
"testing"
|
||||
"errors"
|
||||
)
|
||||
|
||||
func TestForceLeaveCommand_implements(t *testing.T) {
|
||||
|
|
|
@ -498,7 +498,7 @@ func TestCatalogListServices_Blocking(t *testing.T) {
|
|||
}
|
||||
|
||||
// Should block at least 100ms
|
||||
if time.Now().Sub(start) < 100 * time.Millisecond {
|
||||
if time.Now().Sub(start) < 100*time.Millisecond {
|
||||
t.Fatalf("too fast")
|
||||
}
|
||||
|
||||
|
@ -544,7 +544,7 @@ func TestCatalogListServices_Timeout(t *testing.T) {
|
|||
}
|
||||
|
||||
// Should block at least 100ms
|
||||
if time.Now().Sub(start) < 100 * time.Millisecond {
|
||||
if time.Now().Sub(start) < 100*time.Millisecond {
|
||||
// TODO: Failing
|
||||
t.Fatalf("too fast")
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package consul
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"net"
|
||||
"os"
|
||||
"testing"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package consul
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package consul
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package consul
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package consul
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/serf/serf"
|
||||
"os"
|
||||
"testing"
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package consul
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"io/ioutil"
|
||||
|
@ -8,7 +9,6 @@ import (
|
|||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var nextPort = 15000
|
||||
|
@ -293,7 +293,7 @@ func TestServer_JoinLAN_TLS(t *testing.T) {
|
|||
|
||||
// Verify Raft has established a peer
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
return s1.Stats()["raft"]["num_peers"] == "1", nil
|
||||
return s1.Stats()["raft"]["num_peers"] == "1", nil
|
||||
}, func(err error) {
|
||||
t.Fatalf("no peer established")
|
||||
})
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package testutil
|
||||
|
||||
import (
|
||||
"time"
|
||||
"testing"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
type testFn func() (bool, error)
|
||||
|
@ -27,7 +27,7 @@ func WaitForResult(test testFn, error errorFn) {
|
|||
}
|
||||
}
|
||||
|
||||
type rpcFn func(string, interface {}, interface {}) error
|
||||
type rpcFn func(string, interface{}, interface{}) error
|
||||
|
||||
func WaitForLeader(t *testing.T, rpc rpcFn, dc string) structs.IndexedNodes {
|
||||
var out structs.IndexedNodes
|
||||
|
|
Loading…
Reference in New Issue