mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-01 13:39:37 +08:00
https://github.com/gravitational/teleport/issues/53050 was a result of some expensive initialization that ended up impacting end users. Existing benchmark tests did not cover this because they do not actually launch the entire teleport binary. The cost can be observed via `inittrace`, though it is documented that the output is not stable and may be changed at any time. ``` GODEBUG='inittrace=1' ./releases/17.4.1/teleport version 2>&1 | rg '^init' | awk '{print $5 " ms " $2}' | sort -n -r | head -10 170 ms github.com/go-mysql-org/go-mysql/server 2.6 ms github.com/microsoft/go-mssqldb/internal/cp 2.6 ms github.com/goccy/go-json/internal/decoder 2.2 ms cloud.google.com/go/compute/apiv1/computepb 2.0 ms github.com/aws/aws-sdk-go/aws/endpoints 1.8 ms k8s.io/client-go/kubernetes/scheme 1.2 ms github.com/gravitational/teleport/lib/kube/proxy 1.2 ms github.com/gogo/protobuf/types 0.78 ms k8s.io/kubectl/pkg/scheme 0.73 ms github.com/gravitational/teleport/lib/kube/proxy/testing/kube_server ``` In order to cover in a stable way, new tests were added to the tool package of each binary. The tests does one basic thing, re-execute the test binary and exits. The re-execution is required to account for any initialization costs that would otherwise be missed since they happen prior to TestMain being called.