20432 Commits

Author SHA1 Message Date
Marek Siarkowicz
11edde9204
Merge pull request #16622 from fuweid/fix-unparam-lint
*: enable and fix unparam lint
2023-10-18 09:21:22 +02:00
Benjamin Wang
bbf59a9f26
Merge pull request #16789 from fuweid/cleanup-build-cov
*: cleanup main_test.go
2023-10-17 16:31:52 +01:00
Wei Fu
f96000e15d *: cleanup main_test.go
The #15544 has removed the `build_cov` build. And after go1.20, we use
`-cover` buildflag to enable coverage exporter. We don't need to
maintain main_test.go anymore.

```bash
➜  pwd
/home/fuwei/go/src/go.etcd.io/etcd/etcdctl

➜  go build -o /tmp/etcdctl -cover ./

➜  mkdir /tmp/etcdctl-covdata

➜  GOCOVERDIR=/tmp/etcdctl-covdata /tmp/etcdctl get /health

➜  go tool covdata percent -i=/tmp/etcdctl-covdata
        go.etcd.io/etcd/etcdctl/v3      coverage: 66.7% of statements
        go.etcd.io/etcd/etcdctl/v3/ctlv3        coverage: 83.3% of statements
        go.etcd.io/etcd/etcdctl/v3/ctlv3/command        coverage: 15.4% of statements
```

REF: https://go.dev/testing/coverage/

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-17 21:47:23 +08:00
Wei Fu
aea1cd0077 feat: enable unparam lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-17 21:24:13 +08:00
Benjamin Wang
be83fffedb
Merge pull request #16778 from QuentinBisson/patch-1
Fix cluster variable in mixins
2023-10-17 12:59:31 +01:00
Marek Siarkowicz
cba514ef0e
Merge pull request #16651 from siyuanfoundation/livez-pr
Add livez and readyz for etcd
2023-10-17 13:37:45 +02:00
Marek Siarkowicz
e51b639520
Merge pull request #16766 from serathius/robustness-member-replace
Add member replace failpoint to robustness tests
2023-10-17 13:36:21 +02:00
Marek Siarkowicz
5fed813f2e
Merge pull request #16767 from serathius/robustness-main-test
Make the main_test the entrypoint and move senario generation to separate file
2023-10-17 13:09:16 +02:00
Benjamin Wang
36a37190f6
Merge pull request #16783 from sharathsivakumar/shsi/bump_deps_7
Bump dependencies manually
2023-10-17 11:07:43 +01:00
Sharath Sivakumar
b5622a24ba
dependency: bump github.com/google/go-cmp from 0.5.9 to 0.6.0
Signed-off-by: Sharath Sivakumar <mailssr9@gmail.com>
2023-10-17 11:24:25 +02:00
Sharath Sivakumar
3bb27f000c
dependency: bump github.com/alexfalkowski/gocovmerge from 1.2.1 to 1.2.2
Signed-off-by: Sharath Sivakumar <mailssr9@gmail.com>
2023-10-17 11:21:29 +02:00
Marek Siarkowicz
7e8bb15ccb Add member replace failpoint to robustness tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-17 11:17:49 +02:00
Sharath Sivakumar
447aa33a96
dependency: bump golang.org/x/sync from 0.3.0 to 0.4.0
Signed-off-by: Sharath Sivakumar <mailssr9@gmail.com>
2023-10-17 11:15:22 +02:00
Marek Siarkowicz
68e5eb7819
Merge pull request #16777 from serathius/robustness-failpoint
Split failpoints file
2023-10-17 10:54:42 +02:00
Marek Siarkowicz
0d83a72cf5 Split failpoints file
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-17 09:51:43 +02:00
Quentin Bisson
46b42a750e
Fix cluster query
Fix mixin cluster parameter otherwise generated mixins looks like this:

```json
{"type":"prometheus","uid":"${datasource}"},"label":"cluster","name":"job","query":"label_values(etcd_server_has_leader{job=~\".*etcd.*\"}, job)","refresh":2,"type":"query"}]},"time":{"from":"now-15m","to":"now"},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"etcd","uid":"c2f4e12cdf69feb95caa41a5a1b423d9"}`}}
```

where name is job when the variable name used in dashboard queries is cluster.

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
2023-10-16 22:42:31 +02:00
Marek Siarkowicz
452e820516 Make the main_test the entrypoint and move senario generation to separate file
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-16 22:10:41 +02:00
Marek Siarkowicz
252f5a6f4d
Merge pull request #16775 from serathius/robustness-failpoint-package
Move failpoints to separate package
2023-10-16 21:53:03 +02:00
Marek Siarkowicz
d6e376b6c6 Move failpoints to separate package
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-16 20:57:31 +02:00
Benjamin Wang
ad1dbceb44
Merge pull request #16774 from etcd-io/dependabot/github_actions/github/codeql-action-2.22.3
build(deps): bump github/codeql-action from 2.22.1 to 2.22.3
2023-10-16 19:47:04 +01:00
dependabot[bot]
ca56844705
build(deps): bump github/codeql-action from 2.22.1 to 2.22.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.1 to 2.22.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fdcae64e14...0116bc2df5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 17:57:21 +00:00
Benjamin Wang
569640f278
Merge pull request #16763 from ahrtr/changelog_20231016
Update 3.4 & 3.5 changelog
2023-10-16 10:33:05 +01:00
Marek Siarkowicz
4791964173
Merge pull request #16757 from serathius/minimal-time
Use the minimal time event was observed on watch
2023-10-16 11:25:30 +02:00
Benjamin Wang
449d61c661 Update 3.4 & 3.5 changelog
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-10-16 09:54:26 +01:00
Siyuan Zhang
7a57e06eca etcdserver: add livez and ready http endpoints for etcd.
Add two separate probes, one for liveness and one for readiness. The liveness probe would check that the local individual node is up and running, or else restart the node, while the readiness probe would check that the cluster is ready to serve traffic. This would make etcd health-check fully Kubernetes API complient.

Signed-off-by: Siyuan Zhang <sizhang@google.com>
2023-10-14 22:32:16 -07:00
Marek Siarkowicz
aea6f0b4c2
Merge pull request #16759 from serathius/robustness-fix-failure
Fix linearization failure not causing test failure
2023-10-13 19:19:02 +02:00
Marek Siarkowicz
841731bbf0 Fix linearization failure not causing test failure
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-13 18:56:22 +02:00
Marek Siarkowicz
4c7b8dbc94 Use the minimal time event was observed on watch
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-13 18:17:29 +02:00
Marek Siarkowicz
57d9a7eec6
Merge pull request #16756 from serathius/robustness-reorder-validation
Refactor and reorder validation to avoid reporting multiple correlated failures
2023-10-13 18:12:25 +02:00
Marek Siarkowicz
b02798e946 Refactor and reorder validation to avoid reporting multiple corelated failures
It doesn't make sense to report watch failure if key value operations
are not linearizable.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-13 14:06:13 +02:00
Benjamin Wang
3eca40d17c
Merge pull request #16755 from Juneezee/redundant-len-check
etcdserver: remove redundant `len` check in health check
2023-10-13 12:34:54 +01:00
Eng Zer Jun
867faa1924
etcdserver: remove redundant len check in health check
From the Go specification [1]:

  "1. For a nil slice, the number of iterations is 0."

`len` returns 0 if the slice or map is nil [2]. Therefore, checking
`len(v) > 0` around a loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range
[2]: https://pkg.go.dev/builtin#len

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-13 18:39:38 +08:00
Marek Siarkowicz
d0d0c33338
Merge pull request #16708 from fuweid/enable-marker-check
*: enable markdown_marker checker
2023-10-13 11:54:34 +02:00
Benjamin Wang
a92e0de316
Merge pull request #16753 from fuweid/deflake-TestEtcdTLSVersion
tests: deflake TestEtcdTLSVersion
2023-10-13 10:28:04 +01:00
Wei Fu
6f95ea04be tests: deflake TestEtcdTLSVersion
The proc.Stop just sends the SIGTERM to etcd server. The etcd server
needs time to teardown. If we don't wait for it, the etcd server will
hold the port and then next test case, like TestGrpcProxyAutoSync, will
fail to listen on the port 20000.

```bash
file_/__w/etcd/etcd/tests/fixtures/server.crt_--peer-key-file_/__w/etcd/etcd/tests/fixtures/server.key.insecure_--cert-file_/__w/etcd/etcd/tests/fixtures/server2.crt_--key-file_/__w/etcd/etcd/tests/fixtures/server2.key.insecure_--tls-min-version_TLS1.2_--tls-max-version_TLS1.3) (32856): {"level":"info","ts":"2023-10-13T06:12:32.718845Z","caller":"embed/etcd.go:394","msg":"closing etcd server","name":"e1","data-dir":"/tmp/TestEtcdTLSVersion284993522/001","advertise-peer-urls":["https://127.0.0.1:20000"],"advertise-client-urls":["https://0.0.0.0:0"]}
2023-10-13T06:12:32.7399709Z --- PASS: TestEtcdTLSVersion (1.03s)
2023-10-13T06:12:32.7400181Z === RUN   TestGrpcProxyAutoSync
2023-10-13T06:12:32.7401203Z     logger.go:130: 2023-10-13T06:12:32.719Z	INFO	starting server...	{"name": "TestGrpcProxyAutoSync-test-0"}
2023-10-13T06:12:32.7408306Z     logger.go:130: 2023-10-13T06:12:32.719Z	INFO	spawning process	{"args": ["/__w/etcd/etcd/bin/etcd", "--name=TestGrpcProxyAutoSync-test-0", "--listen-client-urls=http://localhost:20000", "--advertise-client-urls=http://localhost:20000", "--listen-peer-urls=http://localhost:20001", "--initial-advertise-peer-urls=http://localhost:20001", "--initial-cluster-token=new", "--data-dir", "/tmp/TestGrpcProxyAutoSync1139610722/001", "--snapshot-count=10000", "--initial-cluster-token=new", "--initial-cluster=TestGrpcProxyAutoSync-test-0=http://localhost:20001", "--initial-cluster-state=new"], "working-dir": "/__w/etcd/etcd/tests/e2e", "name": "TestGrpcProxyAutoSync-test-0", "environment-variables": ["ETCD_VERIFY=all", "EXPECT_DEBUG=true", "PATH=/__t/go/1.21.3/x64/bin:/go/bin:/__t/go/1.21.3/x64/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "ETCD_UNSUPPORTED_ARCH=amd64"]}

...

2023-10-13T06:12:32.7559855Z /__w/etcd/etcd/bin/etcd (TestGrpcProxyAutoSync-test-0) (32863): {"level":"fatal","ts":"2023-10-13T06:12:32.735191Z","caller":"etcdmain/etcd.go:181","msg":"discovery failed","error":"listen tcp 127.0.0.1:20000: bind: address already in use","stacktrace":"go.etcd.io/etcd/server/v3/etcdmain.startEtcdOrProxyV2\n\tgo.etcd.io/etcd/server/v3/etcdmain/etcd.go:181\ngo.etcd.io/etcd/server/v3/etcdmain.Main\n\tgo.etcd.io/etcd/server/v3/etcdmain/main.go:40\nmain.main\n\tgo.etcd.io/etcd/server/v3/main.go:31\nruntime.main\n\truntime/proc.go:267"}
```

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-13 16:48:37 +08:00
Wei Fu
81fe610bd5 *: enable markdown_marker checker
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-13 14:00:25 +08:00
Benjamin Wang
bc0f724ae4
Merge pull request #16697 from chaochn47/health_check_bug_fix
http health check bug fixes
2023-10-13 05:48:24 +01:00
Chao Chen
c25f1dff82 http health check bug fixes
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-10-12 16:59:34 -07:00
Marek Siarkowicz
6d68ab092d
Merge pull request #16707 from serathius/dynamic-flags
Dynamically generate flags passed to etcd binary
2023-10-12 18:23:23 +02:00
Marek Siarkowicz
c34ccfbc06 Dynamically generate flags passed to etcd binary
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-12 17:31:56 +02:00
Marek Siarkowicz
2c86103472
Merge pull request #16748 from serathius/test-dynamic-flags-v2
Test dynamic flags v2
2023-10-12 17:26:18 +02:00
Benjamin Wang
bd49f26e9c
Merge pull request #16752 from fuweid/update-34-changelog
CHANGELOG: update 3.4/3.5 golang version
2023-10-12 16:15:38 +01:00
Wei Fu
42507f4fd8 CHANGELOG: update 3.4/3.5 golang version
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-12 22:35:54 +08:00
Marek Siarkowicz
1caf1d32fc
Merge pull request #16737 from serathius/disable-failfast
Continue on e2e failure
2023-10-12 14:56:49 +02:00
Marek Siarkowicz
c71f60e797 Remove duplicated test
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-12 14:09:31 +02:00
Marek Siarkowicz
05cc60a539 Use contain to make tests clearer and more resilient to changes
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-12 14:09:31 +02:00
Marek Siarkowicz
6f63f4b676 Use single string to define a flag allowing for easier testing
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-12 14:09:29 +02:00
Marek Siarkowicz
d69378bbbd
Merge pull request #16747 from serathius/test-dynamic-flags
Add tests to prepare to dynamic flag generation
2023-10-12 10:47:11 +02:00
Marek Siarkowicz
6d9a0a40b0 Add tests to prepare to dynamic flag generation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-11 23:31:39 +02:00
Benjamin Wang
bf800550c6
Merge pull request #16739 from dusk125/http2-update
bump golang.org/x/net to v0.17.0, google.golang.org/grpc to v1.58.3
2023-10-11 16:25:16 +01:00