fixing golint issues to try to figure out test flakiness

This commit is contained in:
2017-08-05 17:15:45 -07:00
parent be1aefa439
commit 029d1ed5b3
5 changed files with 28 additions and 21 deletions
+6 -5
View File
@@ -14,23 +14,23 @@ import (
)
type World struct {
CH CaddyHugo
CH *CaddyHugo
BlogFolder string
}
func (w World) Clean() {
func (w *World) Clean() {
if w.BlogFolder != "" {
os.RemoveAll(w.BlogFolder)
}
}
func NewWorld(t *testing.T) World {
func NewWorld(t *testing.T) *World {
dir, err := ioutil.TempDir("", "caddy-hugo2-test-")
if err != nil {
t.Fatalf("error initializing test environment: %v", err)
}
w := World{BlogFolder: dir}
w := &World{BlogFolder: dir}
cmd := exec.Command("hugo", "new", "site", dir)
cmd.Dir = dir
@@ -39,6 +39,7 @@ func NewWorld(t *testing.T) World {
t.Fatalf("error initializing test site: %v\n\n%v", err, string(out))
}
w.CH = &CaddyHugo{}
w.CH.Setup(dir)
return w
@@ -232,7 +233,7 @@ func TestDeltasDouble(t *testing.T) {
// send the second message, via clientB
clientB.ReceiveJSON(w.CH.Message(acedoc.Insert(0, 0, "b")))
time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)
clientA.mtx.Lock()
clientB.mtx.Lock()