-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Dynamically generate flags passed to etcd binary #16707
Conversation
9bc7d93
to
b4692a0
Compare
cc @ahrtr |
tests/framework/e2e/cluster.go
Outdated
var value string | ||
if value != "false" && value != "0" { | ||
value = f.Value.String() | ||
} | ||
values[f.Name] = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var value string | |
if value != "false" && value != "0" { | |
value = f.Value.String() | |
} | |
values[f.Name] = value | |
value := f.Value.String() | |
if value != "" && value != "false" && value != "0" { | |
values[f.Name] = value | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the result is different, but I will double check if there impact on the list of flags generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to revert. The code change makes a difference for flags with default value true, that is set to false during the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I have time I will add a unit test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you understand my comment. I am talking about a simple golang syntax problem (although not a big problem): you are checking a variable value
which is always ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I responded, that after I applied you change the test started to consistently fail and it needs further investigation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #16747 I have confirmed that your change breaks logic:
--- FAIL: TestEtcdServerProcessConfig (0.00s)
--- FAIL: TestEtcdServerProcessConfig/StrictReconfigCheck (0.00s)
cluster_test.go:214: diff: []string{
... // 11 identical elements
"/tmp/fake/member-0",
"--initial-cluster-token=new",
+ "--strict-reconfig-check=false",
}
FAIL
FAIL go.etcd.io/etcd/tests/v3/framework/e2e 0.051s
FAIL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please forget my original suggested change. Instead, change
var value string
if value != "false" && value != "0" {
value = f.Value.String()
}
to
value := f.Value.String()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed updated it. PTAL. Now with unit test it should be clear what was the problem.
b4692a0
to
b97d843
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice simplification & refactoring! thx
b97d843
to
3e465be
Compare
Flake |
3aaef78
to
76a07cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Nice work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action needed:
- fix the simple golang programming problem (always checking a variable which is always "") as I mentioned.
- resolve related test failure
Created the PR with tests #16707 |
Signed-off-by: Marek Siarkowicz <[email protected]>
76a07cc
to
c34ccfb
Compare
ping @ahrtr |
Part of #16673 to randomize etcd configuration we need to expand coverage of flags that can be provided in e2e tests. Instead of manually transforming embed.Config struct fields, we can use flagset to automatically generate flags.