Skip to content

Commit

Permalink
Add an integration test for partial message merging at kubernetes
Browse files Browse the repository at this point in the history
Signed-off-by: MOZGIII <[email protected]>
  • Loading branch information
MOZGIII committed Mar 24, 2020
1 parent 772f720 commit 9310817
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/sources/kubernetes/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,33 @@ fn kube_diff_pod_uid() {
false
});
}

#[test]
fn kube_partial() {
let namespace = format!("partial-{}", Uuid::new_v4());
let message = random_string(64 * 1024); // 64 kb
let user_namespace = user_namespace(&namespace);

let kube = Kube::new(&namespace);
let user = Kube::new(&user_namespace);

// Start vector
let vector = start_vector(&kube, user_namespace.as_str(), None);

// Start echo
let _echo = echo(&user, "echo", &message);
// Verify logs
wait_for(|| {
// If any daemon logged message, done.
for line in logs(&kube, &vector) {
if line["message"].as_str().unwrap() == message {
// Very long message arrived as a single (merged) message.
// DONE
return true;
} else {
debug!(namespace=%namespace,log=%line);
}
}
false
});
}

0 comments on commit 9310817

Please sign in to comment.