-
Notifications
You must be signed in to change notification settings - Fork 363
Reuse schema generator for tests #641
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
Conversation
@@ -67,7 +67,7 @@ open class SchemaGenerator(internal val config: SchemaGeneratorConfig) { | |||
builder.codeRegistry(codeRegistry.build()) | |||
val schema = config.hooks.willBuildSchema(builder).build() | |||
|
|||
classScanner.close() |
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.
This will be closed automatically when the schema generator is removed by GC
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'd still explicitly close it just in case
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.
since ScanResult
implements Closeable
we could use Kotlin use
(https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/use.html)
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
I have no idea why these checks are not failing for me locally. I keep running a build on java 11 but it is always passing for me |
In an effort to save memory and build time, I made a common testGenerator that just uses the basic SchemaGeneratorConfig we already we using. Previously, every call to toSchema would create a new SchemaGenerator class which creates a new type cache and class scanner. Maybe this will help with the Github actions?
def109b
to
ce6360b
Compare
Extracting separate changes from ExpediaGroup#641 that cleans up the resources used when creating a new schema generator. Hopefully this will help with our unit test out of memory issues
Closing in favor of #643 |
Extracting separate changes from #641 that cleans up the resources used when creating a new schema generator. Hopefully this will help with our unit test out of memory issues Co-authored-by: Shane Myrick <[email protected]>
Extracting separate changes from ExpediaGroup#641 that cleans up the resources used when creating a new schema generator. Hopefully this will help with our unit test out of memory issues Co-authored-by: Shane Myrick <[email protected]>
📝 Description
In an effort to save memory and build time, I made a common testGenerator that just uses the basic SchemaGeneratorConfig we already we using. Previously, every call to toSchema would create a new SchemaGenerator class which creates a new type cache and class scanner. Maybe this will help with the Github actions out of memory issues?
🔗 Related Issues