test: stabilize distributed load verification
This commit is contained in:
@@ -100,6 +100,16 @@ func TestCoordinatorClientWaitsForBothAgentsAndMergesLedger(t *testing.T) {
|
||||
if err != nil || len(observed) != 1 || observed[0].ClientMid != "unknown" {
|
||||
t.Fatalf("observed=%+v err=%v", observed, err)
|
||||
}
|
||||
if err = client.submitHistory(context.Background(), "a", []string{"mid-2", "mid-1"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = client.submitHistory(context.Background(), "b", []string{"mid-2", "mid-3"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
history, err := client.history(context.Background())
|
||||
if err != nil || len(history) != 3 || history[0] != "mid-1" || history[1] != "mid-2" || history[2] != "mid-3" {
|
||||
t.Fatalf("history=%+v err=%v", history, err)
|
||||
}
|
||||
}
|
||||
|
||||
func testCoordinatorMux(state *coordinatorState) *http.ServeMux {
|
||||
@@ -108,6 +118,7 @@ func testCoordinatorMux(state *coordinatorState) *http.ServeMux {
|
||||
mux.HandleFunc("/v1/start", state.handleStart)
|
||||
mux.HandleFunc("/v1/ledger", state.handleLedger)
|
||||
mux.HandleFunc("/v1/observed", state.handleObserved)
|
||||
mux.HandleFunc("/v1/history", state.handleHistory)
|
||||
mux.HandleFunc("/v1/summary", state.handleSummary)
|
||||
mux.HandleFunc("/v1/status", state.handleStatus)
|
||||
return mux
|
||||
|
||||
Reference in New Issue
Block a user