Do not allocate resources within test constructor#15937
Do not allocate resources within test constructor#15937arhimondr merged 1 commit intoprestodb:masterfrom
Conversation
this is the deprcated form of noreply GH emails |
|
Sure. Thanks |
41d56be to
232855a
Compare
232855a to
36519db
Compare
aweisberg
left a comment
There was a problem hiding this comment.
This doesn't make use of closeAfterClass which is a nice refactor, but lets say that is for later. This also still has some constructors that allocate resources/things which is avoided in several instances in Trino.
Still I wouldn't block on that since it is forward progress and the PR is already broken because it hasn't landed. Would like to get the API change in.
I don't understand why this is necessary both in and of itself (is it just for cleanliness and safe constructors?) and specifically as a dependency.
Since I rebased it doesn't build on some tests.
There was a problem hiding this comment.
This is still creating a resource in the constructor. It also happens in 2-3 places above.
There was a problem hiding this comment.
I'll move it to @BeforeVlass
There was a problem hiding this comment.
That won't work because the resource is required in createdQueryRunner and it is called before @BeforeClass. I think the resource created in constructor is Ok here, we don't pass it to super class.
There was a problem hiding this comment.
The original indentation was wrong.
8a03411 to
d8895d5
Compare
It's not just for cleanliness and safe constructor, it's a dependency because super class of TestElasticsearchIntegrationSmokeTest needs a QueryRunner created by EmbeddedElasticsearchNode. We can adapt it but I think it's better to remove the resource from constructors. |
d8895d5 to
d97f339
Compare
Cherry-pick of trinodb/trino#2412 Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
d97f339 to
001bc1b
Compare
Cherry-pick of trinodb/trino#2412
Co-authored-by: Piotr Findeisen findepi@users.noreply.github.com
Test plan - Make sure all CI tests pass.
Depends on https://github.com/facebookexternal/presto-facebook/pull/1542