harmonytask lints
This commit is contained in:
parent
6fd468dfc0
commit
c7aaa16e03
@ -5,7 +5,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -82,14 +81,9 @@ func TestHarmonyTasks(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
time.Sleep(3 * time.Second) // do the work. FLAKYNESS RISK HERE.
|
time.Sleep(3 * time.Second) // do the work. FLAKYNESS RISK HERE.
|
||||||
e.GracefullyTerminate(time.Minute)
|
e.GracefullyTerminate(time.Minute)
|
||||||
require.Equal(t, t1.WorkCompleted, 2, "wrong amount of work complete: expected 2 got:")
|
expected := []string{"taskResult56", "taskResult73"}
|
||||||
sort.Strings(t1.WorkCompleted)
|
sort.Strings(t1.WorkCompleted)
|
||||||
got := strings.Join(t1.WorkCompleted, ",")
|
require.Equal(t, len(t1.WorkCompleted), expected, "unexpected results")
|
||||||
expected := "taskResult56,taskResult73"
|
|
||||||
if got != expected {
|
|
||||||
t.Fatal("Unexpected results! Wanted " + expected + " got " + got)
|
|
||||||
}
|
|
||||||
// TODO test history table looks right.
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +317,8 @@ func (e *TaskEngine) GetHttpHandlers() http.Handler {
|
|||||||
s := root.PathPrefix("/scheduler")
|
s := root.PathPrefix("/scheduler")
|
||||||
f := s.PathPrefix("/follows")
|
f := s.PathPrefix("/follows")
|
||||||
b := s.PathPrefix("/bump")
|
b := s.PathPrefix("/bump")
|
||||||
for name, vs := range e.follows {
|
for name, vsTmp := range e.follows {
|
||||||
|
vs := vsTmp
|
||||||
f.Path("/" + name + "/{tID}").Methods("GET").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
f.Path("/" + name + "/{tID}").Methods("GET").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
tIDString := mux.Vars(r)["tID"]
|
tIDString := mux.Vars(r)["tID"]
|
||||||
tID, err := strconv.Atoi(tIDString)
|
tID, err := strconv.Atoi(tIDString)
|
||||||
|
Loading…
Reference in New Issue
Block a user