Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade the go toolchain to go1.23.1. #32

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Upgrade the go toolchain to go1.23.1. #32

merged 2 commits into from
Oct 3, 2024

Conversation

renormalize
Copy link
Member

@renormalize renormalize commented Oct 1, 2024

How to categorize this PR?

/area dev-productivity
/area security
/kind enhancement

What this PR does / why we need it:

  • Upgrades the Go dependency to go1.23.1.

  • Upgrades the golangci-lint version to v1.61.0. The older version is incompatible with go1.23.1, and the linter has to be upgraded to work with go1.23.1. The older version has a memory leak which causes the process to leak memory and start consuming memory around 120GB. The upgrade fixes this.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

The tests will fail since the tests run on the older pipeline definitions on master.

Release note:

Upgrade the Go dependency to `go1.23.1`.

@renormalize renormalize added area/compliance Compliance related area/dev-productivity Developer productivity related (how to improve development) area/security Security related dependencies Pull requests that update a dependency file labels Oct 1, 2024
@renormalize renormalize self-assigned this Oct 1, 2024
@renormalize renormalize requested a review from a team as a code owner October 1, 2024 12:48
@gardener-robot gardener-robot added needs/review Needs review kind/enhancement Enhancement, improvement, extension labels Oct 1, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 1, 2024
@gardener-robot gardener-robot added the size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) label Oct 1, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 1, 2024
@seshachalam-yv
Copy link
Contributor

Can you run make check? When I execute it, I encounter the following issue:

Executing golangci-lint
./hack/check.sh: line 23:  7111 Killed: 9               golangci-lint run $GOLANGCI_LINT_CONFIG_FILE --timeout 10m "$@"
make: *** [check] Error 137

@renormalize
Copy link
Member Author

renormalize commented Oct 3, 2024

@seshachalam-yv I was seeing the same issue on my side as well, before raising the PR. I will figure it out and keep you posted here.
Interestingly, I'm facing the same issue on the main branch as well.

@gardener-robot gardener-robot added size/s Size of pull request is small (see gardener-robot robot/bots/size.py) and removed size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Oct 3, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 3, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 3, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 3, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 3, 2024
@renormalize
Copy link
Member Author

@seshachalam-yv I've upgraded the golangci-lint dependency to the latest version, which fixes the problem that we both were seeing. The older version had a memory leak and ended up consuming around 120GB of memory on my local machine before the process got killed by the OS.
Just remember to explicitly remove the binary from your hack/tools/bin directory before running make check again. It should work fine now.

* The older version of `golangci-lint` on version `v1.52.1` was
  consuming an inordinate amount of memory, and thus ended up getting
  killed by the OS mid run.
  See golangci/golangci-lint#3582.

* Upgrade to a newer version of `golangci-lint`, `v1.61.0`.

* Fix all lint errors reported with the newer version.
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 3, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 3, 2024
@renormalize
Copy link
Member Author

Outputs of each make target:

make check passes
> Check
Executing golangci-lint
make test passes
> Test...
> Running tests...
=== RUN   TestAddEtcdFlags
--- PASS: TestAddEtcdFlags (0.00s)
PASS
coverage: 28.0% of statements
ok  	github.com/gardener/etcd-wrapper/cmd	0.022s	coverage: 28.0% of statements
	github.com/gardener/etcd-wrapper/internal/testutil		coverage: 0.0% of statements
=== RUN   TestSuit
=== RUN   TestSuit/queryAndUpdateEtcdReadiness
    readycheck_test.go:67: etcd ready status should be set to true when etcd query succeeds
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:67: etcd ready status should be set to false when etcd query fails
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
{"level":"warn","ts":"2024-10-03T14:19:12.333+0530","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-204eb460-17eb-454c-893e-d3891793822a/:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp :2379: connect: connection refused\""}
{"level":"error","msg":"failed to retrieve from etcd db","error":"context deadline exceeded"}
=== RUN   TestSuit/readinessHandler
    readycheck_test.go:97: should return http.StatusOK when etcdStatus.Ready is set to true
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:97: should return http.StatusServiceUnavailable when etcdStatus.Ready is set to false
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
=== RUN   TestSuit/createEtcdClient
    readycheck_test.go:135: should return valid etcd client with HTTP scheme when no certificates are passed
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:135: should return valid etcd client with HTTPS scheme when all certificates are passed
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:135: should return valid etcd client with HTTP scheme when empty certificate file path is passed
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:135: should return valid etcd client with HTTP scheme when empty key file path is passed
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:135: should return valid etcd client with HTTP scheme when empty CA cert file path is passed
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:135: should return error when wrong certificate file path is passed
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
=== RUN   TestSuit/isTLSEnabled
    readycheck_test.go:172: should return true when all files are present
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:172: should return false when only certFile is not present
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:172: should return false when only keyFile is not present
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:172: should return false when only trusterCAFile is not present
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
    readycheck_test.go:172: should return true when all files not are present
{"level":"info","msg":"Initializing application","config":{"BackupRestore":{"HostPort":":2379","TLSEnabled":false,"CaCertBundlePath":""},"EtcdClientTLS":{"ServerName":"","CertPath":"","KeyPath":""}}}
--- PASS: TestSuit (5.86s)
    --- PASS: TestSuit/queryAndUpdateEtcdReadiness (5.00s)
    --- PASS: TestSuit/readinessHandler (0.00s)
    --- PASS: TestSuit/createEtcdClient (0.01s)
    --- PASS: TestSuit/isTLSEnabled (0.00s)
PASS
coverage: 31.7% of statements
ok  	github.com/gardener/etcd-wrapper/internal/app	5.898s	coverage: 31.7% of statements
=== RUN   TestCleanupExitCodeFile
=== RUN   TestCleanupExitCodeFile/cleanup_exit_code_file_when_file_exists
=== RUN   TestCleanupExitCodeFile/cleanup_exit_code_file_when_it_does_not_exist
--- PASS: TestCleanupExitCodeFile (0.00s)
    --- PASS: TestCleanupExitCodeFile/cleanup_exit_code_file_when_file_exists (0.00s)
    --- PASS: TestCleanupExitCodeFile/cleanup_exit_code_file_when_it_does_not_exist (0.00s)
=== RUN   TestCaptureExitCode
=== RUN   TestCaptureExitCode/do_nothing_when_signal_is_nil
=== RUN   TestCaptureExitCode/capture_signal_in_exit_code_when_it_is_not_nil
=== RUN   TestCaptureExitCode/return_error_when_WriteFile_fails
--- PASS: TestCaptureExitCode (0.00s)
    --- PASS: TestCaptureExitCode/do_nothing_when_signal_is_nil (0.00s)
    --- PASS: TestCaptureExitCode/capture_signal_in_exit_code_when_it_is_not_nil (0.00s)
    --- PASS: TestCaptureExitCode/return_error_when_WriteFile_fails (0.00s)
=== RUN   TestGetValidationMode
=== RUN   TestGetValidationMode/exit_code_file_not_being_present_should_result_in_full_validation
    bootstrap_test.go:134: exit code file not being present should result in full validation
=== NAME  TestGetValidationMode
    logger.go:130: 2024-10-03T14:19:06.488+0530	ERROR	error in checking if exitCodeFile exists, assuming full-validation to be done.	{"exitCodeFilePath": "/var/folders/jj/dzvcbqd54s1gbt9rtjbs9mtc0000gn/T/etcd-wrapper3461004532/exit_code", "error": "stat /var/folders/jj/dzvcbqd54s1gbt9rtjbs9mtc0000gn/T/etcd-wrapper3461004532/exit_code: no such file or directory"}
=== RUN   TestGetValidationMode/exit_code_having_error_string_`interrupt`_should_result_in_sanity_validation
    bootstrap_test.go:134: exit code having error string `interrupt` should result in sanity validation
=== NAME  TestGetValidationMode
    logger.go:130: 2024-10-03T14:19:06.489+0530	INFO	last captured exit code read, assuming sanity validation to be done.	{"exitCodeFilePath": "/var/folders/jj/dzvcbqd54s1gbt9rtjbs9mtc0000gn/T/etcd-wrapper4071691899/exit_code", "signal-captured": "interrupt"}
=== RUN   TestGetValidationMode/exit_code_having_error_string_`terminated`_should_result_in_sanity_validation
    bootstrap_test.go:134: exit code having error string `terminated` should result in sanity validation
=== NAME  TestGetValidationMode
    logger.go:130: 2024-10-03T14:19:06.491+0530	INFO	last captured exit code read, assuming sanity validation to be done.	{"exitCodeFilePath": "/var/folders/jj/dzvcbqd54s1gbt9rtjbs9mtc0000gn/T/etcd-wrapper4077807403/exit_code", "signal-captured": "terminated"}
=== RUN   TestGetValidationMode/exit_code_having_any_other_error_string_should_result_in_full_validation
    bootstrap_test.go:134: exit code having any other error string should result in full validation
=== NAME  TestGetValidationMode
    logger.go:130: 2024-10-03T14:19:06.494+0530	ERROR	error in checking if exitCodeFile exists, assuming full-validation to be done.	{"exitCodeFilePath": "/var/folders/jj/dzvcbqd54s1gbt9rtjbs9mtc0000gn/T/etcd-wrapper4167465723/exit_code"}
--- PASS: TestGetValidationMode (0.01s)
    --- PASS: TestGetValidationMode/exit_code_file_not_being_present_should_result_in_full_validation (0.00s)
    --- PASS: TestGetValidationMode/exit_code_having_error_string_`interrupt`_should_result_in_sanity_validation (0.00s)
    --- PASS: TestGetValidationMode/exit_code_having_error_string_`terminated`_should_result_in_sanity_validation (0.00s)
    --- PASS: TestGetValidationMode/exit_code_having_any_other_error_string_should_result_in_full_validation (0.00s)
=== RUN   TestTryGetEtcdConfig
=== RUN   TestTryGetEtcdConfig/should_not_return_error_when_etcd_config_is_returned
    bootstrap_test.go:163: should not return error when etcd config is returned
2024-10-03T14:19:06.495+0530	INFO	bootstrap/bootstrap.go:112	Fetched and written etcd configuration	{"path": "/var/folders/jj/dzvcbqd54s1gbt9rtjbs9mtc0000gn/T/etcd-wrapper1449230646/etcdConfig.yaml"}
[WARNING] Deprecated '--logger=capnslog' flag is set; use '--logger=zap' flag instead
2024-10-03 14:19:06.495235 W | embed: Running http and grpc server on single port. This is not recommended for production.
=== RUN   TestTryGetEtcdConfig/should_return_error_when_invalid_etcd_config_is_returned
    bootstrap_test.go:163: should return error when invalid etcd config is returned
2024-10-03T14:19:07.496+0530	INFO	util/retry.go:59	re-attempting operation	{"operation": "GetEtcdConfig", "current-attempt": 0, "error": "server returned error response code when attempting to fetch etcd config: &{ 404  0 0 map[] 0x1400038a980 14 [] false false map[] <nil> <nil>}"}
2024-10-03T14:19:08.498+0530	INFO	util/retry.go:59	re-attempting operation	{"operation": "GetEtcdConfig", "current-attempt": 1, "error": "server returned error response code when attempting to fetch etcd config: &{ 404  0 0 map[] 0x14000098380 14 [] false false map[] <nil> <nil>}"}
2024-10-03T14:19:09.499+0530	INFO	util/retry.go:59	re-attempting operation	{"operation": "GetEtcdConfig", "current-attempt": 2, "error": "server returned error response code when attempting to fetch etcd config: &{ 404  0 0 map[] 0x1400017c780 14 [] false false map[] <nil> <nil>}"}
2024-10-03T14:19:10.500+0530	INFO	util/retry.go:59	re-attempting operation	{"operation": "GetEtcdConfig", "current-attempt": 3, "error": "server returned error response code when attempting to fetch etcd config: &{ 404  0 0 map[] 0x1400038aa00 14 [] false false map[] <nil> <nil>}"}
2024-10-03T14:19:11.501+0530	INFO	util/retry.go:59	re-attempting operation	{"operation": "GetEtcdConfig", "current-attempt": 4, "error": "server returned error response code when attempting to fetch etcd config: &{ 404  0 0 map[] 0x1400017c7a0 14 [] false false map[] <nil> <nil>}"}
2024-10-03T14:19:11.501+0530	ERROR	util/retry.go:62	all retries exhausted	{"operation": "GetEtcdConfig", "numAttempts": 5}
github.com/gardener/etcd-wrapper/internal/util.Retry[...]
	/Users/i585850/go/src/github.com/gardener/etcd-wrapper/internal/util/retry.go:62
github.com/gardener/etcd-wrapper/internal/bootstrap.(*initializer).tryGetEtcdConfig
	/Users/i585850/go/src/github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:105
github.com/gardener/etcd-wrapper/internal/bootstrap.TestTryGetEtcdConfig.func1
	/Users/i585850/go/src/github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap_test.go:181
testing.tRunner
	/Users/i585850/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.1.darwin-arm64/src/testing/testing.go:1690
--- PASS: TestTryGetEtcdConfig (5.01s)
    --- PASS: TestTryGetEtcdConfig/should_not_return_error_when_etcd_config_is_returned (0.00s)
    --- PASS: TestTryGetEtcdConfig/should_return_error_when_invalid_etcd_config_is_returned (5.01s)
=== RUN   TestNewEtcdInitializer
=== RUN   TestNewEtcdInitializer/should_return_error_when_invalid_sidecar_config_is_passed
    bootstrap_test.go:201: should return error when invalid sidecar config is passed
=== RUN   TestNewEtcdInitializer/should_return_error_when_br_client_creation_fails
    bootstrap_test.go:201: should return error when br client creation fails
=== RUN   TestNewEtcdInitializer/should_not_return_error_when_sidecar_config_is_valid_and_br_client_creation_succeeds
    bootstrap_test.go:201: should not return error when sidecar config is valid and br client creation succeeds
--- PASS: TestNewEtcdInitializer (0.00s)
    --- PASS: TestNewEtcdInitializer/should_return_error_when_invalid_sidecar_config_is_passed (0.00s)
    --- PASS: TestNewEtcdInitializer/should_return_error_when_br_client_creation_fails (0.00s)
    --- PASS: TestNewEtcdInitializer/should_not_return_error_when_sidecar_config_is_valid_and_br_client_creation_succeeds (0.00s)
PASS
coverage: 57.4% of statements
ok  	github.com/gardener/etcd-wrapper/internal/bootstrap	5.050s	coverage: 57.4% of statements
=== RUN   TestSuite
=== RUN   TestSuite/getEtcdConfig
    brclient_test.go:78: 200 response code should return a valid etcd config
    brclient_test.go:78: 202 response code should return a valid etcd config
    brclient_test.go:78: 201 response code should return a valid etcd config
    brclient_test.go:78: 208 response code should return an error
    brclient_test.go:78: 400 response code should return an error
    brclient_test.go:78: should return an error when sidecar base address is invalid
=== RUN   TestSuite/getInitializationStatus
    brclient_test.go:118: New initialization status returned by server should result in New
    brclient_test.go:118: InProgress initialization status returned by server should result in InProgress
    brclient_test.go:118: Successful initialization status returned by server should result in Successful
    brclient_test.go:118: Unknown initialization status returned by server should result in InProgress
    brclient_test.go:118: Bad response from server should result in Unknown
    brclient_test.go:118: When sidecar base address is invalid should return an error and result in Unknown
=== RUN   TestSuite/triggerInitializer
    brclient_test.go:148: server returning a valid response should not result in an error
    brclient_test.go:148: server returning an error code should result in an error
    brclient_test.go:148: should return an error when sidecar base address is invalid
=== RUN   TestSuite/createClient
    brclient_test.go:176: return error when incorrect sidecar config (CA filepath) is passed
    brclient_test.go:176: return etcd client when valid sidecar config is passed
--- PASS: TestSuite (3.43s)
    --- PASS: TestSuite/getEtcdConfig (0.01s)
    --- PASS: TestSuite/getInitializationStatus (0.00s)
    --- PASS: TestSuite/triggerInitializer (0.00s)
    --- PASS: TestSuite/createClient (0.01s)
=== RUN   TestNewDefaultClient
    brclient_test.go:199: return error when incorrect sidecar config is passed
    brclient_test.go:199: return backuprestore client when valid sidecar config is passed
--- PASS: TestNewDefaultClient (0.57s)
PASS
coverage: 90.3% of statements
ok  	github.com/gardener/etcd-wrapper/internal/brclient	4.027s	coverage: 90.3% of statements
=== RUN   TestSetupSignalHandler
callback called.
    logger.go:130: 2024-10-03T14:19:06.476+0530	INFO	caught shutdown signal	{"signal": "interrupt"}
--- PASS: TestSetupSignalHandler (5.00s)
PASS
coverage: 91.7% of statements
ok  	github.com/gardener/etcd-wrapper/internal/signal	5.027s	coverage: 91.7% of statements
=== RUN   TestGetBaseAddressWithTLSEnabled
--- PASS: TestGetBaseAddressWithTLSEnabled (0.00s)
=== RUN   TestGetBaseAddressWithTLSDisabled
--- PASS: TestGetBaseAddressWithTLSDisabled (0.00s)
=== RUN   TestValidate
    config_test.go:49: missing host should result in error
    config_test.go:49: missing port should result in error
    config_test.go:49: should allow empty host
    config_test.go:49: should disallow specifying scheme
    config_test.go:49: should disallow empty caCertBundlePath when TLS is enabled
--- PASS: TestValidate (0.00s)
PASS
coverage: 66.7% of statements
ok  	github.com/gardener/etcd-wrapper/internal/types	0.018s	coverage: 66.7% of statements
=== RUN   TestResponseHasOKCode
    http_test.go:27: 200 response code should return true
    http_test.go:27: 201 response code should return true
    http_test.go:27: 202 response code should return true
    http_test.go:27: 400 response code should return true
--- PASS: TestResponseHasOKCode (0.00s)
=== RUN   TestConstructBaseAddress
    http_test.go:47: tls is enabled
    http_test.go:47: tls is disabled
--- PASS: TestConstructBaseAddress (0.00s)
=== RUN   TestErrorIfExceedsAttempts
=== RUN   TestErrorIfExceedsAttempts/num_attempts_exhausted
=== NAME  TestErrorIfExceedsAttempts
    logger.go:130: 2024-10-03T14:19:07.479+0530	INFO	re-attempting operation	{"operation": "always-fails", "current-attempt": 0, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:08.481+0530	INFO	re-attempting operation	{"operation": "always-fails", "current-attempt": 1, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:09.482+0530	INFO	re-attempting operation	{"operation": "always-fails", "current-attempt": 2, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:10.483+0530	INFO	re-attempting operation	{"operation": "always-fails", "current-attempt": 3, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:11.484+0530	INFO	re-attempting operation	{"operation": "always-fails", "current-attempt": 4, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:11.484+0530	ERROR	all retries exhausted	{"operation": "always-fails", "numAttempts": 5}
=== RUN   TestErrorIfExceedsAttempts/neverRetry_short-circuits_num-attempts
--- PASS: TestErrorIfExceedsAttempts (5.01s)
    --- PASS: TestErrorIfExceedsAttempts/num_attempts_exhausted (5.01s)
    --- PASS: TestErrorIfExceedsAttempts/neverRetry_short-circuits_num-attempts (0.00s)
=== RUN   TestSuccessWhenEventuallySucceeds
    logger.go:130: 2024-10-03T14:19:12.485+0530	INFO	re-attempting operation	{"operation": "eventually-succeeds", "current-attempt": 0, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:13.487+0530	INFO	re-attempting operation	{"operation": "eventually-succeeds", "current-attempt": 1, "error": "attempt failed"}
--- PASS: TestSuccessWhenEventuallySucceeds (2.00s)
=== RUN   TestRetryWhenContextCancelled
    logger.go:130: 2024-10-03T14:19:14.488+0530	INFO	re-attempting operation	{"operation": "context-cancelled", "current-attempt": 0, "error": "attempt failed"}
    logger.go:130: 2024-10-03T14:19:14.489+0530	ERROR	context has been cancelled. stopping retry	{"operation": "context-cancelled", "error": "context canceled"}
--- PASS: TestRetryWhenContextCancelled (1.00s)
=== RUN   TestCreateCACertPool
    tls_test.go:41: should return error when empty ca cert file path is passed
    tls_test.go:41: should return error when wrong ca cert file path is passed
    tls_test.go:41: should not return error when valid ca cert file path is passed
--- PASS: TestCreateCACertPool (2.90s)
=== RUN   TestCreateTLSConfigWhenTLSDisabled
--- PASS: TestCreateTLSConfigWhenTLSDisabled (0.00s)
=== RUN   TestCreateTLSConfig
--- PASS: TestCreateTLSConfig (2.53s)
PASS
coverage: 87.8% of statements
ok  	github.com/gardener/etcd-wrapper/internal/util	13.470s	coverage: 87.8% of statements
github.com/gardener/etcd-wrapper/cmd/command.go:36:				IsCommandSupported		0.0%
github.com/gardener/etcd-wrapper/cmd/etcd.go:50:				AddEtcdFlags			100.0%
github.com/gardener/etcd-wrapper/cmd/etcd.go:61:				InitAndStartEtcd		0.0%
github.com/gardener/etcd-wrapper/cmd/help.go:28:				PrintHelp			0.0%
github.com/gardener/etcd-wrapper/cmd/help.go:36:				executeTemplate			0.0%
github.com/gardener/etcd-wrapper/internal/app/app.go:36:			NewApplication			80.0%
github.com/gardener/etcd-wrapper/internal/app/app.go:53:			Setup				0.0%
github.com/gardener/etcd-wrapper/internal/app/app.go:66:			Start				0.0%
github.com/gardener/etcd-wrapper/internal/app/app.go:104:			Close				66.7%
github.com/gardener/etcd-wrapper/internal/app/app.go:111:			cancelContext			100.0%
github.com/gardener/etcd-wrapper/internal/app/app.go:118:			startEtcd			0.0%
github.com/gardener/etcd-wrapper/internal/app/fakes.go:17:			Get				100.0%
github.com/gardener/etcd-wrapper/internal/app/fakes.go:22:			Put				0.0%
github.com/gardener/etcd-wrapper/internal/app/fakes.go:27:			Delete				0.0%
github.com/gardener/etcd-wrapper/internal/app/fakes.go:32:			Compact				0.0%
github.com/gardener/etcd-wrapper/internal/app/fakes.go:37:			Txn				0.0%
github.com/gardener/etcd-wrapper/internal/app/fakes.go:42:			Do				0.0%
github.com/gardener/etcd-wrapper/internal/app/readycheck.go:33:			SetupReadinessProbe		0.0%
github.com/gardener/etcd-wrapper/internal/app/readycheck.go:54:			queryAndUpdateEtcdReadiness	0.0%
github.com/gardener/etcd-wrapper/internal/app/readycheck.go:75:			isEtcdReady			100.0%
github.com/gardener/etcd-wrapper/internal/app/readycheck.go:86:			readinessHandler		100.0%
github.com/gardener/etcd-wrapper/internal/app/readycheck.go:95:			createEtcdClient		85.7%
github.com/gardener/etcd-wrapper/internal/app/readycheck.go:120:		isTLSEnabled			100.0%
github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:39:		NewEtcdInitializer		100.0%
github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:58:		Run				0.0%
github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:86:		CaptureExitCode			100.0%
github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:95:		CleanupExitCode			100.0%
github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:103:		tryGetEtcdConfig		100.0%
github.com/gardener/etcd-wrapper/internal/bootstrap/bootstrap.go:116:		determineValidationMode		83.3%
github.com/gardener/etcd-wrapper/internal/bootstrap/loggerutil.go:13:		SetupLoggerConfig		0.0%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:67:		NewDefaultClient		87.5%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:81:		NewClient			100.0%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:89:		GetInitializationStatus		92.9%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:116:		TriggerInitialization		100.0%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:132:		GetEtcdConfig			83.3%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:154:		createAndExecuteHTTPRequest	88.9%
github.com/gardener/etcd-wrapper/internal/brclient/brclient.go:174:		createClient			100.0%
github.com/gardener/etcd-wrapper/internal/brclient/initstatus_string.go:7:	_				0.0%
github.com/gardener/etcd-wrapper/internal/brclient/initstatus_string.go:21:	String				66.7%
github.com/gardener/etcd-wrapper/internal/signal/signal.go:26:			SetupHandler			91.7%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:28:			NewTLSResourceCreator		75.0%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:42:			pemEncode			100.0%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:51:			EncodeAndWrite			83.3%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:69:			CreateCACertAndKey		75.0%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:96:			CreateETCDClientCertAndKey	75.0%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:119:			createCACertTemplate		85.7%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:131:			createCertTemplate		75.0%
github.com/gardener/etcd-wrapper/internal/testutil/tls.go:152:			generateSerialNumber		100.0%
github.com/gardener/etcd-wrapper/internal/types/config.go:42:			Validate			100.0%
github.com/gardener/etcd-wrapper/internal/types/config.go:60:			GetBaseAddress			100.0%
github.com/gardener/etcd-wrapper/internal/types/config.go:65:			GetHost				0.0%
github.com/gardener/etcd-wrapper/internal/util/http.go:17:			ResponseHasOKCode		100.0%
github.com/gardener/etcd-wrapper/internal/util/http.go:31:			CloseResponseBody		0.0%
github.com/gardener/etcd-wrapper/internal/util/http.go:45:			ConstructBaseAddress		100.0%
github.com/gardener/etcd-wrapper/internal/util/retry.go:27:			IsErr				0.0%
github.com/gardener/etcd-wrapper/internal/util/retry.go:34:			Retry				87.5%
github.com/gardener/etcd-wrapper/internal/util/retry.go:68:			AlwaysRetry			0.0%
github.com/gardener/etcd-wrapper/internal/util/tls.go:14:			CreateCACertPool		100.0%
github.com/gardener/etcd-wrapper/internal/util/tls.go:37:			CreateTLSConfig			100.0%
total:										(statements)			64.4%

make build passes
> Build...

@renormalize renormalize merged commit ff0297a into main Oct 3, 2024
2 of 5 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 3, 2024
@renormalize renormalize deleted the go1.23.1 branch October 3, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/compliance Compliance related area/dev-productivity Developer productivity related (how to improve development) area/security Security related dependencies Pull requests that update a dependency file kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants