Skip to content
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

Merged
merged 2 commits into from
Aug 10, 2021
Merged

Build: Fix slow tests #773

merged 2 commits into from
Aug 10, 2021

Conversation

rozza
Copy link
Member

@rozza rozza commented Aug 5, 2021

@rozza rozza self-assigned this Aug 5, 2021
includeTags('Slow')
}
}

task testSlowGroovy(type: Test) {
Copy link
Member Author

@rozza rozza Aug 5, 2021

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 ?!

Copy link
Member

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')
Copy link
Member Author

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' })
Copy link
Member Author

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,
Copy link
Member Author

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
Copy link
Member Author

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'
Copy link
Member Author

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.

@rozza rozza requested review from jyemin and stIncMale August 5, 2021 15:22
Copy link
Member

@stIncMale stIncMale left a 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) {
Copy link
Member

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).

Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

LGTM

@rozza rozza merged commit fb6388c into mongodb:master Aug 10, 2021
@rozza rozza deleted the JAVA-4145 branch August 10, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants