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

fix failing tests after rustc and serde update #5564

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion quickwit/quickwit-common/src/rendezvous_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mod tests {
let mut socket_set3 = vec![socket1, socket4];
sort_by_rendez_vous_hash(&mut socket_set3, "key");

assert_eq!(socket_set1, &[socket1, socket2, socket3, socket4]);
assert_eq!(socket_set1, &[socket1, socket3, socket2, socket4]);
assert_eq!(socket_set2, &[socket1, socket2, socket4]);
assert_eq!(socket_set3, &[socket1, socket4]);
}
Expand Down
30 changes: 15 additions & 15 deletions quickwit/quickwit-search/src/cluster_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,30 +746,30 @@ mod tests {
#[tokio::test]
async fn test_put_kv_happy_path() {
// 3 servers 1, 2, 3
// Targeted key has affinity [2, 3, 1].
// Targeted key has affinity [3, 2, 1].
//
// Put on 2 and 3 is successful
// Get succeeds on 2.
// Get succeeds on 3.
let mock_search_service_1 = MockSearchService::new();
let mut mock_search_service_2 = MockSearchService::new();
mock_search_service_2.expect_put_kv().once().returning(
// Due to the buffered call it is possible for the
// put request to 2 to be emitted too.
mock_search_service_2
.expect_put_kv()
.returning(|_put_req: quickwit_proto::search::PutKvRequest| {});
let mut mock_search_service_3 = MockSearchService::new();
mock_search_service_3.expect_put_kv().once().returning(
|put_req: quickwit_proto::search::PutKvRequest| {
assert_eq!(put_req.key, b"my_key");
assert_eq!(put_req.payload, b"my_payload");
},
);
mock_search_service_2.expect_get_kv().once().returning(
mock_search_service_3.expect_get_kv().once().returning(
|get_req: quickwit_proto::search::GetKvRequest| {
assert_eq!(get_req.key, b"my_key");
Some(b"my_payload".to_vec())
},
);
let mut mock_search_service_3 = MockSearchService::new();
// Due to the buffered call it is possible for the
// put request to 3 to be emitted too.
mock_search_service_3
.expect_put_kv()
.returning(|_put_req: quickwit_proto::search::PutKvRequest| {});
let searcher_pool = searcher_pool_for_test([
("127.0.0.1:1001", mock_search_service_1),
("127.0.0.1:1002", mock_search_service_2),
Expand All @@ -791,11 +791,11 @@ mod tests {
#[tokio::test]
async fn test_put_kv_failing_get() {
// 3 servers 1, 2, 3
// Targeted key has affinity [2, 3, 1].
// Targeted key has affinity [3, 2, 1].
//
// Put on 2 and 3 is successful
// Get fails on 2.
// Get succeeds on 3.
// Get fails on 3.
// Get succeeds on 2.
let mock_search_service_1 = MockSearchService::new();
let mut mock_search_service_2 = MockSearchService::new();
mock_search_service_2.expect_put_kv().once().returning(
Expand All @@ -807,7 +807,7 @@ mod tests {
mock_search_service_2.expect_get_kv().once().returning(
|get_req: quickwit_proto::search::GetKvRequest| {
assert_eq!(get_req.key, b"my_key");
None
Some(b"my_payload".to_vec())
},
);
let mut mock_search_service_3 = MockSearchService::new();
Expand All @@ -820,7 +820,7 @@ mod tests {
mock_search_service_3.expect_get_kv().once().returning(
|get_req: quickwit_proto::search::GetKvRequest| {
assert_eq!(get_req.key, b"my_key");
Some(b"my_payload".to_vec())
None
},
);
let searcher_pool = searcher_pool_for_test([
Expand Down
9 changes: 5 additions & 4 deletions quickwit/quickwit-search/src/search_job_placer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,22 @@ mod tests {

let expected_searcher_addr_1: SocketAddr = ([127, 0, 0, 1], 1001).into();
let expected_searcher_addr_2: SocketAddr = ([127, 0, 0, 1], 1002).into();
// on a small number of splits, we may be unbalanced
let expected_assigned_jobs = vec![
(
expected_searcher_addr_1,
vec![
SearchJob::for_test("split5", 5),
SearchJob::for_test("split4", 4),
SearchJob::for_test("split3", 3),
SearchJob::for_test("split2", 2),
SearchJob::for_test("split1", 1),
],
),
(
expected_searcher_addr_2,
vec![
SearchJob::for_test("split6", 6),
SearchJob::for_test("split2", 2),
SearchJob::for_test("split1", 1),
SearchJob::for_test("split5", 5),
SearchJob::for_test("split4", 4),
],
),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ mod tests {
serde_qs::from_str::<ElasticBulkOptions>("refresh=wait")
.unwrap_err()
.to_string(),
"unknown variant `wait`, expected one of `false`, `true`, `wait_for`"
"unknown variant `wait`, expected one of `false`, ``, `true`, `wait_for`"
);
}
}
Loading