(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestPingPong(t *testing.T) { |
| 93 | const testName = "pingpong" |
| 94 | cp, c, _ := setup(t, testOpts{testName: testName}) |
| 95 | |
| 96 | resources := e2e.DefaultClientResources(e2e.ResourceParams{ |
| 97 | DialTarget: testName, |
| 98 | NodeID: cp.nodeID, |
| 99 | Host: "localhost", |
| 100 | Port: serverPort, |
| 101 | SecLevel: e2e.SecurityLevelNone, |
| 102 | }) |
| 103 | |
| 104 | ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) |
| 105 | defer cancel() |
| 106 | if err := cp.server.Update(ctx, resources); err != nil { |
| 107 | t.Fatalf("failed to update control plane resources: %v", err) |
| 108 | } |
| 109 | |
| 110 | st, err := c.clientStats(ctx) |
| 111 | if err != nil { |
| 112 | t.Fatalf("failed to get client stats: %v", err) |
| 113 | } |
| 114 | if st.NumFailures != 0 { |
| 115 | t.Fatalf("Got %v failures: %+v", st.NumFailures, st) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // TestAffinity covers the affinity tests with ringhash policy. |
| 120 | // - client is configured to use ringhash, with 3 backends |
nothing calls this directly
no test coverage detected