Skip to content

Remove incorrect test-skipping logic #1186

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

Merged
merged 4 commits into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

import static com.mongodb.ClusterFixture.isDiscoverableReplicaSet;
import static com.mongodb.ClusterFixture.isSharded;
import static com.mongodb.ClusterFixture.serverVersionLessThan;
import static com.mongodb.JsonTestServerVersionChecker.skipTest;
import static com.mongodb.client.Fixture.getDefaultDatabaseName;
import static com.mongodb.client.Fixture.getMongoClientSettingsBuilder;
Expand Down Expand Up @@ -89,6 +90,11 @@ protected BsonDocument getDefinition() {
@Before
public void setUp() {
assumeFalse(skipTest);
// Remove this as part of JAVA-5125
if (isSharded() && serverVersionLessThan(5, 0)) {
assumeFalse(description.contains("succeeds after WriteConcernError"));
assumeFalse(description.contains("fails after multiple retryable writeConcernErrors"));
}
collectionHelper = new CollectionHelper<>(new DocumentCodec(), new MongoNamespace(databaseName, collectionName));
BsonDocument clientOptions = definition.getDocument("clientOptions", new BsonDocument());
MongoClientSettings.Builder builder = getMongoClientSettingsBuilder();
Expand Down Expand Up @@ -254,7 +260,7 @@ public static Collection<Object[]> data() throws URISyntaxException, IOException
data.add(new Object[]{file.getName(), test.asDocument().getString("description").getValue(),
testDocument.getString("database_name", new BsonString(getDefaultDatabaseName())).getValue(),
testDocument.getArray("data"), test.asDocument(),
!isDiscoverableReplicaSet() || skipTest(testDocument, test.asDocument())});
skipTest(testDocument, test.asDocument())});
}
}
return data;
Expand Down