etcd icon indicating copy to clipboard operation
etcd copied to clipboard

Cover learners with e2e tests

Open serathius opened this issue 2 years ago • 16 comments

Based on https://github.com/etcd-io/etcd/pull/13837 I expect we are missing some e2e testing.

serathius avatar Apr 10 '22 13:04 serathius

@serathius would be ok if I work on this?

bobsongplus avatar Apr 13 '22 13:04 bobsongplus

Sure, to give you some context, most of etcd e2e tests either run 1 or 3 member cluster. Most test scenarios would benefit if we add a case where there is an additional learner in cluster. For examples of test code I would look into code in tests/common.

serathius avatar Apr 13 '22 14:04 serathius

Working on it

bobsongplus avatar Apr 14 '22 15:04 bobsongplus

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 13 '22 23:07 stale[bot]

@TinySong any progress?

serathius avatar Jul 15 '22 07:07 serathius

want to work on this issue

halegreen avatar Oct 23 '22 12:10 halegreen

kubeadm using etcd learner mode to join the control plane node.

  • we add some e2e test in https://github.com/kubernetes/test-infra/pull/28574

pacoxu avatar Oct 13 '23 08:10 pacoxu

@jmhbnz can u assign me please ?

Elbehery avatar Jan 04 '24 19:01 Elbehery

Absolutely! Thanks for volunteering 🙏🏻

/assign @Elbehery

jmhbnz avatar Jan 04 '24 19:01 jmhbnz

Hello @serathius

I need more context to resolve this, below are initial ideas

  • add IsLearner field to https://github.com/etcd-io/etcd/blob/f37a4365ee824825984fd0660f970eb596cb02d5/tests/framework/e2e/etcd_process.go#L80
  • add AddMemberAsLearner to e2e interface

i am quiet lost, where to start .. also could you inline some specific cases to cover ?

thanks :)

cc @ahrtr @jmhbnz

Elbehery avatar Jan 24 '24 14:01 Elbehery

@Elbehery we would want to add learners to basic e2e tests scenarios that should not care that there is a learner in the cluster. Take a look into https://github.com/etcd-io/etcd/blob/main/tests/common/e2e_test.go on how we automatically generate subtests for different cluster configurations.

serathius avatar Jan 25 '24 14:01 serathius

Thanks @serathius for your response ..

I reviewed the tests yesterday .. So for example, for https://github.com/etcd-io/etcd/blob/main/tests/common/member_test.go, we should add a test that adds a learner member ?

also to create an etcd learner member server process, do i follow the same EtcdServerProcessConfig while adding a boolean for IsLearner ?

wdyt ?

Elbehery avatar Jan 25 '24 14:01 Elbehery

I reviewed the tests yesterday .. So for example, for https://github.com/etcd-io/etcd/blob/main/tests/common/member_test.go, we should add a test that adds a learner member ?

I think there already exists a test for adding a learner member. https://github.com/etcd-io/etcd/blob/58846bd8f3bedee3260623301d1c02a99580a2a9/tests/e2e/ctl_v3_member_test.go#L46 Context on why we have two directories with tests https://github.com/etcd-io/etcd/issues/13637

serathius avatar Jan 26 '24 09:01 serathius