149 Commits

Author SHA1 Message Date
Benjamin Wang
5a437a3c55 Cleanup github.com/etcd-io/gofail
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-08-02 13:21:59 +01:00
Wei Fu
55bce22e97 chore: enable strict mode for test CI
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-04-02 08:57:56 +08:00
James Blair
183af509f6
Formatted source code for go 1.19.6.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-20 21:33:59 +13:00
Dirkjan Bussink
1a9742c9c4 release: build with consistent paths
This changes the builds to always add -trimpath which removes specific
build time paths from the binary (like current directories etc).

Improves build reproducability to make the final binary independent from
the specific build path.

Lastly, when stripping debug symbols, also add -w to strip DWARF symbols
as well which aren't needed in that case either.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-11-21 15:19:51 +01:00
Aleksandr Razumov
c91978077b client/pkg/fileutil: add missing logger to {Create,Touch}DirAll
Also populate it to every invocation.

Signed-off-by: WangXiaoxiao <1141195807@qq.com>
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-17 14:08:30 +01:00
Marek Siarkowicz
a060b42e47 server: Use default logging configuration instead of zap production one
This fixes problem where logs json changes format of timestamp.
2022-04-01 12:23:44 +02:00
Piotr Tabor
c09aca1ba4 Split etcdctl into etcdctl (public API access) & etcdutl (direct surgery on files)
Motivation is as follows:

  - etcdctl we only depend on clientv3 APIs, no dependencies of bolt, backend, mvcc, file-layout
  - etcdctl can be officially supported across wide range of versions, while etcdutl is pretty specific to file format at particular version.
it's step towards desired modules layout, documented in: https://etcd.io/docs/next/dev-internal/modules/
2021-05-17 11:54:03 +02:00
Gyuho Lee
19fcefae70 tests: rename "master" branch references to "main"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2021-05-12 10:38:12 -07:00
tangcong
4fb22093a6 functional: add SHORT_TTL_LEASE_EXPIRE checker 2021-04-26 20:00:45 +08:00
tangcong
16e38e49a9 functional: add FAILPOINTS_WITH_DISK_IO_LATENCY case 2021-04-26 12:07:05 +08:00
tangcong
370f9cf3b9 fix: failed to get failpoints from member 2021-04-26 11:44:53 +08:00
Piotr Tabor
3bb7acc8cf Migrate dependencies pkg/foo -> client/pkg/foo 2021-04-07 00:38:47 +02:00
wpedrak
dac6e37ea1 *: over 20 staticcheck fixes 2021-03-18 15:06:17 +01:00
Piotr Tabor
c8243a9927 Tests: Functional - in case of failure, log the exception. 2021-03-09 18:19:52 +01:00
Piotr Tabor
351bdb33c5 Split intengration/clientv3 tests into multiple packages
They used to take >10min with coverage, so were causing interrupted
Travis runs.

Know thay fit in 100-150s (together), thanks also to parallel
execution.
2021-01-23 11:12:44 +01:00
Piotr Tabor
598ca6caab Modernize release script:
- making sure the DRY_RUN mode can finish e2e, so e.g. commits to
local copy of repository are OK in dry-run (while git pushes are NOT).
  - better interaction with ./test_lib.sh script.
  - more consistent logging
  - bringing back s390x architecture that on go 1.14.3 seems to work as
expected.
2021-01-21 17:47:36 +01:00
Piotr Tabor
577c898fee scripts: Integrate ./scripts/release with new code for tagging modules.
Changes:
  - signing tags.
  - allows to override BRANCH and REPOSITORY using env variables.

Tested by a release in my private fork:
  BRANCH="20201126-ptabor-release" REPOSITORY="git@github.com:ptabor/etcd.git" ./scripts/release 3.5.0-alpha.20
2021-01-15 12:31:44 +01:00
Piotr Tabor
e2a65bee6e Avoid 'interactive prompt' for root password in etcd tests.
Before:
```
{"level":"info","ts":1610273495.3791487,"caller":"agent/handler.go:668","msg":"cleaning up page cache"}
{"level":"info","ts":1610273495.3793094,"caller":"agent/handler.go:94","msg":"created etcd log file","path":"/tmp/etcd-functional-2/etcd.log"}
{"level":"info","ts":1610273495.379328,"caller":"agent/handler.go:668","msg":"cleaning up page cache"}
[sudo] password for ptab:
pam_glogin: invalid password
Sorry, try again.
[sudo] password for ptab:
```

Now the caches are dropped if the current users is in sudoers, bot not
in the other cases.
To be honest I don't see the purpose for dropping the caches at all in
the test.
2021-01-11 10:06:31 +01:00
Piotr Tabor
aaf423e962 server: Update imports.
find -name '*.go' | xargs sed -i --follow-symlinks 's|etcd/v3/|etcd/server/v3/|g'
2020-10-26 13:02:32 +01:00
Piotr Tabor
09679d29ad etcdctl: Rename of imports after making etcdctl a module.
```
find -name '*.go' | xargs sed -i --follow-symlinks 's|etcd/v3/etcdctl|etcd/etcdctl/v3|g'
```
2020-10-21 11:15:35 +02:00
Piotr Tabor
e33c6dd9df client/v3: Rename of imports 2020-10-20 10:13:06 +02:00
Piotr Tabor
e62417297d *: Rename of imports of raft (as its now a module)
% find -name '*.go' -o -name '*.md' -o -name '*.sh' | xargs sed -i --follow-symlinks 's|etcd/v3/raft|etcd/raft/v3|g'
2020-10-16 13:58:18 +02:00
Piotr Tabor
45e4306508 client: Move client to client/v2 as a module.
We make v2 client code a module go.etcd.io/etcd/client/v2.

Pretty mechanical change that can be summarized as:

  mkdir client/v2
  cd client/v2 && git mod init go.etcd.io/etcd/client/v2

  git mv client/*.go client/v2/
  find -name '*.go' | xargs sed -i --follow-symlinks 's|/v3/client["]|/client/v2\"|g'

  + fixing changelog, bom, go.mod etc.
2020-10-15 14:39:43 +02:00
Piotr Tabor
de55bb6331 pkg: Rename imports after making 'pkg' a module
find -name '*.go' | xargs sed --follow-symlinks -i 's|go.etcd.io/etcd/v3/pkg/|go.etcd.io/etcd/pkg/v3/|g'
go fmt ./...
2020-10-13 00:09:27 +02:00
Piotr Tabor
30811a06aa etcdctl, clientv3/snapshot: snapshot (Restore,Status) code out of client
"snapshot" Restore/Status code was the only remaining dependency of client on 'server'
code. The code is solelly used by etcdctl. Long-term the snapshot code
should be migrated to 'etcdadm' style of tool such that we can
distinguish tool solelly depending on networking API vs. tools that
operation on etcd files directly.

We left snapshot.Save() code in clientv3.snapshot package, such that
clients can benefits from automated download&safe to file snapshot
functionality over the wire.
2020-10-10 14:14:57 +02:00
Piotr Tabor
b382429d01 tests: Move functional tests to 'tests' module.
Tested with:

PASSES="fmt functional unit" ./test
make build-docker-functional
2020-10-07 15:09:26 +02:00
Piotr Tabor
8907b146d4 tests/functional: Mechanical rename of imports etcd/v3/functional/ -> etcd/tests/v3/functional/...
% find ./ -name "*.go" | xargs sed -i "s|go.etcd.io/etcd/v3/functional/agent|go.etcd.io/etcd/tests/v3/functional/agent|g"
% find ./ -name "*.go" | xargs sed -i "s|go.etcd.io/etcd/v3/functional/runner|go.etcd.io/etcd/tests/v3/functional/runner|g"
% find ./ -name "*.go" | xargs sed -i "s|go.etcd.io/etcd/v3/functional/tester|go.etcd.io/etcd/tests/v3/functional/tester|g"
% find ./ -name "*.go" | xargs sed -i "s|go.etcd.io/etcd/v3/functional/rpcpb|go.etcd.io/etcd/tests/v3/functional/rpcpb|g"
2020-10-07 15:09:12 +02:00
Piotr Tabor
69254d8cf8 functional,tests: git mv functional tests/
Modularization: Mechanical move of "functional" directory into tests module using:

% git mv functional tests/
2020-10-07 15:03:51 +02:00
Xiang Li
2ba57ee75d *: remove unused pkgs 2014-09-03 09:20:20 -07:00
Blake Mizerany
d77773acb3 server: ignore server in build/tests 2014-09-03 09:20:06 -07:00
Yicheng Qin
0197ce4c66 server: move TestMultiNodeKillAllAndRecovery to etcd/ 2014-09-03 09:20:00 -07:00
Yicheng Qin
215820dd40 server: move TestMultiNodeKillOne to etcd/ 2014-09-03 09:20:00 -07:00
Yicheng Qin
a0fbc289ec server: move discovery tests to etcd/
TestDiscoveryDownNoBackupPeersWithDataDir -> TestRunByDataDir
remove TestDiscoveryRestart
2014-09-03 09:20:00 -07:00
Yicheng Qin
01322cd243 server: move TestClusterConfigReload to etcd/ 2014-09-03 09:20:00 -07:00
Yicheng Qin
efaef49734 server: move TestSingleNodeRecovery under etcd/ 2014-09-03 09:20:00 -07:00
Xiang Li
3fba10c8e6 etcd: add version handlers 2014-09-03 09:19:58 -07:00
Yicheng Qin
6534525cf8 server: add bootstrap tests 2014-09-03 09:19:57 -07:00
Xiang Li
0ccd09532b etcd: add joinThroughFollower test 2014-09-03 09:19:52 -07:00
Xiang Li
a0c0638744 tests: remove unnecessary test 2014-09-03 09:19:51 -07:00
Xiang Li
60c8dbe0c9 etcd: rewrite kill_leader and kill_random test 2014-09-03 09:19:51 -07:00
Yicheng Qin
02ced2c2d7 v1: deprecate v1 support
Etcd moves to 0.5 without the support of v1.
2014-09-03 09:19:49 -07:00
Rob Strong
494d2c67aa fix(peer_server) set content type to application/json in admin 2014-06-21 13:13:10 -04:00
Yicheng Qin
25e69d9659 fix(multi_node_kill_all_and_recovery_test): ensure cluster is up 2014-06-02 14:43:51 -07:00
Yicheng Qin
e04a188358 fix(remove_node_test): remove unnecessary cluster configuration
The cluster configuration operation is originally to make sure
the instance won't be added back automatically between removal and
check for the number of existing peer-mode instances. But this
could make some node removed before the removal command.

Use longer sync interval instead to avoid this problem.
2014-06-02 13:30:19 -07:00
Yicheng Qin
7cb126967c fix(simple_snapshot_test): enlarge reasonable index range 2014-05-31 10:42:31 -07:00
Yicheng Qin
444e017c05 fix(remove_node_test): ensure cluster config is activated 2014-05-31 10:32:03 -07:00
Yicheng Qin
356675b70f fix(multi_node_kill_all_and_recovery_test): ensure cluster running 2014-05-31 10:15:03 -07:00
Yicheng Qin
37796ed84c tests: add TestMultiNodeKillAllAndRecorveryAndRemoveLeader
This one breaks because it doesn't set joinIndex correctly.
2014-05-31 10:01:45 -07:00
Yicheng Qin
ca29691543 tests(standby_test): comments 2014-05-30 18:36:23 -07:00
Yicheng Qin
4bebb538eb fix(standby_server): able to join the cluster containing itself
Standby server will switch to peer server if it finds that
it has been contained in the cluster.
2014-05-30 14:03:49 -07:00