Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@jasontedor jasontedor left a 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"));
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@jasontedor jasontedor left a 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
@DaveCTurner DaveCTurner merged commit c041e94 into elastic:master Sep 20, 2018
@DaveCTurner DaveCTurner deleted the 2018-09-18-test-transient-settings-override-persistent-ones branch September 20, 2018 10:17
DaveCTurner added a commit that referenced this pull request Sep 20, 2018
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.
kcm pushed a commit that referenced this pull request Oct 30, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants