Skip to content

Commit

Permalink
Revert "fix failing test after rustc and serde update (#5564)"
Browse files Browse the repository at this point in the history
This reverts commit cbf35fa.
  • Loading branch information
fulmicoton committed Dec 10, 2024
1 parent 7d614c8 commit e38a7d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
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 [3, 2, 1].
// Targeted key has affinity [2, 3, 1].
//
// Put on 2 and 3 is successful
// Get succeeds on 3.
// Get succeeds on 2.
let mock_search_service_1 = MockSearchService::new();
let mut mock_search_service_2 = MockSearchService::new();
// 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(
mock_search_service_2.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_3.expect_get_kv().once().returning(
mock_search_service_2.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 [3, 2, 1].
// Targeted key has affinity [2, 3, 1].
//
// Put on 2 and 3 is successful
// Get fails on 3.
// Get succeeds on 2.
// Get fails 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(
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");
Some(b"my_payload".to_vec())
None
},
);
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");
None
Some(b"my_payload".to_vec())
},
);
let searcher_pool = searcher_pool_for_test([
Expand Down
10 changes: 5 additions & 5 deletions quickwit/quickwit-search/src/search_job_placer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,22 +430,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
// 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("split5", 5),
SearchJob::for_test("split4", 4),
SearchJob::for_test("split2", 2),
SearchJob::for_test("split1", 1),
],
),
];
Expand Down

0 comments on commit e38a7d9

Please sign in to comment.