-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Build: Fix slow tests #773
Conversation
JAVA-4145
includeTags('Slow') | ||
} | ||
} | ||
|
||
task testSlowGroovy(type: 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.
Had to create a custom task just for the groovy tests and that fixes the issue ?!
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, thats's what seem to be suggested as the solution, which is unfortunate: spockframework/spock#1288 (comment).
@@ -274,10 +274,17 @@ configure(javaCodeCheckedProjects) { | |||
} | |||
|
|||
task testSlowOnly(type: Test) { | |||
dependsOn('testSlowGroovy') |
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.
Add the spock test dependency
@@ -39,7 +40,6 @@ import static com.mongodb.ClusterFixture.getServerApi | |||
import static com.mongodb.ClusterFixture.getSslSettings | |||
import static com.mongodb.internal.connection.CommandHelper.executeCommand | |||
|
|||
@IgnoreIf({ System.getProperty('ignoreSlowUnitTests') == 'true' }) |
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 seems to be a legacy system property
@@ -49,9 +49,9 @@ class AsyncStreamTimeoutsSpecification extends OperationFunctionalSpecification | |||
@IgnoreIf({ getSslSettings().isEnabled() }) | |||
def 'should throw a MongoSocketOpenException when the AsynchronousSocket Stream fails to open'() { | |||
given: | |||
def connection = new InternalStreamConnectionFactory( | |||
def connection = new InternalStreamConnectionFactory(ClusterConnectionMode.SINGLE, |
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.
These changes are just to bring the code up to date.
@@ -156,7 +156,7 @@ class DefaultConnectionPoolSpecification extends Specification { | |||
Thread.sleep(500) | |||
|
|||
then: 'it prunes the existing connections and again ensures the minimum size of the pool' | |||
connectionFactory.createdConnections.size() == 10 | |||
connectionFactory.createdConnections.size() == 5 |
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 was a test bug.
@@ -39,10 +39,10 @@ import static util.JsonPoweredTestHelper.getTestDocument | |||
|
|||
class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecification { | |||
|
|||
private final String collectionName = 'ClientSideEncryptionBsonSizeLimitsSpecification' | |||
private final String collName = 'ClientSideEncryptionBsonSizeLimitsSpecification' |
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.
Side effect of Spock dependency update? Theres a getCollectionName
method in the FunctionalSpecification
and spock complained they clashed.
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 is great, thank you @rozza! 💪
includeTags('Slow') | ||
} | ||
} | ||
|
||
task testSlowGroovy(type: 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.
Yes, thats's what seem to be suggested as the solution, which is unfortunate: spockframework/spock#1288 (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
JAVA-4145
https://spruce.mongodb.com/version/610bebf90ae606191fe957b7 - for the slow tests