mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-25 22:39:38 +00:00
fix wrong assertion on tests
Signed-off-by: xin.li <xin.li@daocloud.io>
This commit is contained in:
@@ -217,7 +217,9 @@ func TestReadinessAggregatedAPIServiceDiscovery(t *testing.T) {
|
||||
}
|
||||
}))
|
||||
go func() {
|
||||
require.NoError(t, service.Run(ctx))
|
||||
if err := service.Run(ctx); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
}()
|
||||
require.NoError(t, service.WaitForReady(ctx))
|
||||
|
||||
@@ -306,7 +308,9 @@ func TestAggregatedAPIServiceDiscovery(t *testing.T) {
|
||||
}
|
||||
}))
|
||||
go func() {
|
||||
require.NoError(t, service.Run(ctx))
|
||||
if err := service.Run(ctx); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
}()
|
||||
require.NoError(t, service.WaitForReady(ctx))
|
||||
|
||||
|
||||
@@ -69,7 +69,9 @@ func TestSlowAPIServiceOpenAPIDoesNotBlockHealthCheck(t *testing.T) {
|
||||
http.ServeContent(w, r, "/openapi/v2", time.Now(), bytes.NewReader(data))
|
||||
}))
|
||||
go func() {
|
||||
require.NoError(t, service.Run(ctx))
|
||||
if err := service.Run(ctx); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
}()
|
||||
require.NoError(t, service.WaitForReady(ctx))
|
||||
|
||||
@@ -131,7 +133,9 @@ func TestFetchingOpenAPIBeforeReady(t *testing.T) {
|
||||
http.ServeContent(w, r, "/openapi/v2", time.Now(), bytes.NewReader(data))
|
||||
}))
|
||||
go func() {
|
||||
require.NoError(t, service.Run(ctx))
|
||||
if err := service.Run(ctx); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
}()
|
||||
require.NoError(t, service.WaitForReady(ctx))
|
||||
|
||||
|
||||
@@ -136,7 +136,9 @@ func BuildAndRunTestServer(t *testing.T, caPath, caKeyPath, issuerOverride strin
|
||||
writer.WriteHeader(http.StatusOK)
|
||||
|
||||
err = json.NewEncoder(writer).Encode(token)
|
||||
require.NoError(t, err)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
mux.HandleFunc(authWebPath, func(writer http.ResponseWriter, request *http.Request) {
|
||||
@@ -150,7 +152,9 @@ func BuildAndRunTestServer(t *testing.T, caPath, caKeyPath, issuerOverride strin
|
||||
writer.WriteHeader(http.StatusOK)
|
||||
|
||||
err := json.NewEncoder(writer).Encode(keySet)
|
||||
require.NoError(t, err)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
return oidcServer
|
||||
|
||||
Reference in New Issue
Block a user