From c9711e14c345a4b67fd408427787422b7b37453b Mon Sep 17 00:00:00 2001 From: Yexiang Zhang Date: Wed, 20 Dec 2023 16:49:54 +0800 Subject: [PATCH 1/2] This is an automated cherry-pick of #226 Signed-off-by: ti-chi-bot --- Makefile | 2 +- config/config.go | 2 +- config/config_test.go | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a0a78d6..6bc995c 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,4 @@ lint: tools/bin/golangci-lint GO111MODULE=on tools/bin/golangci-lint run -v $$($(PACKAGE_DIRECTORIES)) --config .golangci.yml tools/bin/golangci-lint: - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ./tools/bin v1.51.1 + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ./tools/bin v1.55.2 diff --git a/config/config.go b/config/config.go index e9ea47a..cc88fcf 100644 --- a/config/config.go +++ b/config/config.go @@ -24,7 +24,7 @@ import ( ) const ( - DefProfilingEnable = false // TODO(mornyx): Enable when tiflash#5687 is fixed. + DefProfilingEnable = false // TODO(mornyx): Enable when tiflash#5285 is fixed. DefProfilingIntervalSeconds = 60 DefProfileSeconds = 10 DefProfilingTimeoutSeconds = 120 diff --git a/config/config_test.go b/config/config_test.go index f45dac0..26a177c 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -85,8 +85,13 @@ key-path = "ngm.key"` require.NotNil(t, cfg) data, err := json.Marshal(cfg) require.NoError(t, err) +<<<<<<< HEAD // TODO(mornyx): Rollback when tiflash#5687 is fixed. require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) +======= + // TODO(mornyx): Rollback when tiflash#5285 is fixed. + require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"},"tsdb":{"retention_period":"1","search_max_unique_timeseries":300000}}`, string(data)) +>>>>>>> 401c463 (*: update golangci-lint version to fix ci (#226)) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -113,8 +118,13 @@ path = "data1"` require.Equal(t, getCfg(), globalCfg) data, err = json.Marshal(globalCfg) require.NoError(t, err) +<<<<<<< HEAD // TODO(mornyx): Rollback when tiflash#5687 is fixed. require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) +======= + // TODO(mornyx): Rollback when tiflash#5285 is fixed. + require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"},"tsdb":{"retention_period":"1","search_max_unique_timeseries":300000}}`, string(data)) +>>>>>>> 401c463 (*: update golangci-lint version to fix ci (#226)) cfgData = `` err = ioutil.WriteFile(cfgFileName, []byte(cfgData), 0666) @@ -124,8 +134,13 @@ path = "data1"` time.Sleep(time.Millisecond * 10) data, err = json.Marshal(GetGlobalConfig()) require.NoError(t, err) +<<<<<<< HEAD // TODO(mornyx): Rollback when tiflash#5687 is fixed. require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) +======= + // TODO(mornyx): Rollback when tiflash#5285 is fixed. + require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"},"tsdb":{"retention_period":"1","search_max_unique_timeseries":300000}}`, string(data)) +>>>>>>> 401c463 (*: update golangci-lint version to fix ci (#226)) } func TestConfigValid(t *testing.T) { From c6c40c98f2d2d711cdbc8d21d80a082bc67dc245 Mon Sep 17 00:00:00 2001 From: mornyx Date: Wed, 20 Dec 2023 16:57:04 +0800 Subject: [PATCH 2/2] fix conflicts Signed-off-by: mornyx --- config/config_test.go | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/config/config_test.go b/config/config_test.go index 26a177c..b3449db 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -85,13 +85,8 @@ key-path = "ngm.key"` require.NotNil(t, cfg) data, err := json.Marshal(cfg) require.NoError(t, err) -<<<<<<< HEAD - // TODO(mornyx): Rollback when tiflash#5687 is fixed. - require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) -======= // TODO(mornyx): Rollback when tiflash#5285 is fixed. - require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"},"tsdb":{"retention_period":"1","search_max_unique_timeseries":300000}}`, string(data)) ->>>>>>> 401c463 (*: update golangci-lint version to fix ci (#226)) + require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -118,13 +113,8 @@ path = "data1"` require.Equal(t, getCfg(), globalCfg) data, err = json.Marshal(globalCfg) require.NoError(t, err) -<<<<<<< HEAD - // TODO(mornyx): Rollback when tiflash#5687 is fixed. - require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) -======= // TODO(mornyx): Rollback when tiflash#5285 is fixed. - require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"},"tsdb":{"retention_period":"1","search_max_unique_timeseries":300000}}`, string(data)) ->>>>>>> 401c463 (*: update golangci-lint version to fix ci (#226)) + require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) cfgData = `` err = ioutil.WriteFile(cfgFileName, []byte(cfgData), 0666) @@ -134,13 +124,8 @@ path = "data1"` time.Sleep(time.Millisecond * 10) data, err = json.Marshal(GetGlobalConfig()) require.NoError(t, err) -<<<<<<< HEAD - // TODO(mornyx): Rollback when tiflash#5687 is fixed. - require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) -======= // TODO(mornyx): Rollback when tiflash#5285 is fixed. - require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"},"tsdb":{"retention_period":"1","search_max_unique_timeseries":300000}}`, string(data)) ->>>>>>> 401c463 (*: update golangci-lint version to fix ci (#226)) + require.Equal(t, `{"address":"0.0.0.0:12020","advertise_address":"10.0.1.8:12020","pd":{"endpoints":["10.0.1.8:2378","10.0.1.9:2379"]},"log":{"path":"log","level":"INFO"},"storage":{"path":"data"},"continuous_profiling":{"enable":false,"profile_seconds":10,"interval_seconds":60,"timeout_seconds":120,"data_retention_seconds":259200},"security":{"ca_path":"ngm.ca","cert_path":"ngm.cert","key_path":"ngm.key"}}`, string(data)) } func TestConfigValid(t *testing.T) {