Skip to content

Commit

Permalink
Add doc on blocked flag used in sniffer and remove tracning duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourya742 committed Mar 4, 2025
1 parent a9cbf0a commit fcdb68e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions roles/tests-integration/lib/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ impl Sniffer {
downstream_messages: MessagesAggregator,
action: Option<Action>,
) -> Result<(), SnifferError> {
// Blocking flag used in the IgnoreFromMessage action to stop processing messages after the
// desired interception.
let mut blocked = false;
while let Ok(mut frame) = recv.recv().await {
if blocked {
Expand Down Expand Up @@ -331,6 +333,8 @@ impl Sniffer {
upstream_messages: MessagesAggregator,
action: Option<Action>,
) -> Result<(), SnifferError> {
// Blocking flag used in the IgnoreFromMessage action to stop processing messages after the
// desired interception.
let mut blocked = false;
while let Ok(mut frame) = recv.recv().await {
if blocked {
Expand Down
1 change: 0 additions & 1 deletion roles/tests-integration/tests/sniffer_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ async fn test_sniffer_wait_for_message_type_with_remove() {
/// `TP -> sniffer_a -> sniffer_b -> sniffer_c -> Pool`
#[tokio::test]
async fn test_sniffer_blocks_message() {
start_tracing();
let (_tp, tp_addr) = start_template_provider(None);

// Define an action to block SetupConnectionSuccess messages going downstream.
Expand Down

0 comments on commit fcdb68e

Please sign in to comment.