-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Test that transient settings beat persistent ones #33818
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
Test that transient settings beat persistent ones #33818
Conversation
Transient settings override persistent settings, but in fact all of the tests that run as part of `:server:test` and `:server:integTest` will pass if the precedence is changed to be the other way round. This change adds a test that verifies the precedence is as documented.
|
Pinging @elastic/es-core-infra |
jasontedor
left a comment
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.
Thanks for adding this test, it's really good to have tests for fundamental assumptions such as this. 🙈
I left a request.
| .persistentSettings(Settings.builder().put("key", "persistent-value").build()) | ||
| .transientSettings(Settings.builder().put("key", "transient-value").build()).build(); | ||
|
|
||
| assertThat(metaData.settings().get("key"), equalTo("transient-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 did not check but I think it should be possible to test this with a setting object instead doing a raw get on the settings instance; that is Settings#get(String) versus Setting#get(settings). Would you please write the test that way? It is more realistic.
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.
Yes, this was possible. I pushed 1ec65d0.
jasontedor
left a comment
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.
jasontedor
left a comment
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.
…18-test-transient-settings-override-persistent-ones
Transient settings override persistent settings, but in fact all of the tests that run as part of `:server:test` and `:server:integTest` will pass if the precedence is changed to be the other way round. This change adds a test that verifies the precedence is as documented.
Transient settings override persistent settings, but in fact all of the tests that run as part of `:server:test` and `:server:integTest` will pass if the precedence is changed to be the other way round. This change adds a test that verifies the precedence is as documented.
Transient settings override persistent settings, but in fact all of the tests
that run as part of
:server:testand:server:integTestwill pass if theprecedence is changed to be the other way round. This change adds a test that
verifies the precedence is as documented.