Skip to content

Commit 453db30

Browse files
authored
RUST-1709 Update changestream split test version bounds (#930)
1 parent e6892af commit 453db30

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/test/change_stream.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,9 @@ async fn split_large_event() -> Result<()> {
718718
let _guard = LOCK.run_concurrently().await;
719719

720720
let client = Client::test_builder().build().await;
721-
if !client.server_version_gte(7, 0) {
721+
if !(client.server_version_matches(">= 6.0.9, < 6.1")
722+
|| client.server_version_matches(">= 7.0"))
723+
{
722724
log_uncaptured(format!(
723725
"skipping change stream test on unsupported version {:?}",
724726
client.server_version

src/test/util.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,21 @@ impl TestClient {
326326

327327
pub(crate) fn supports_fail_command(&self) -> bool {
328328
let version = if self.is_sharded() {
329-
VersionReq::parse(">= 4.1.5").unwrap()
329+
">= 4.1.5"
330330
} else {
331-
VersionReq::parse(">= 4.0").unwrap()
331+
">= 4.0"
332332
};
333-
version.matches(&self.server_version)
333+
self.server_version_matches(version)
334+
}
335+
336+
pub(crate) fn server_version_matches(&self, req: &str) -> bool {
337+
VersionReq::parse(req)
338+
.unwrap()
339+
.matches(&self.server_version)
334340
}
335341

336342
pub(crate) fn supports_block_connection(&self) -> bool {
337-
let version = VersionReq::parse(">= 4.2.9").unwrap();
338-
version.matches(&self.server_version)
343+
self.server_version_matches(">= 4.2.9")
339344
}
340345

341346
/// Whether the deployment supports failing the initial handshake

0 commit comments

Comments
 (0)