Skip to content

OTAP Exporter remove sleeps from unit tests #1611

@albertlockett

Description

@albertlockett

The OTAP exporter uses some random sleeps while the server is starting/stopping to test the behaviour of sending gRPC requests while the server is not ready tor receive connections.

// send a request before while the server isn't running and check how we handle it
let log_message = create_otap_batch(LOG_BATCH_ID, ArrowPayloadType::Logs);
pdata_tx
.send(OtapPdata::new_default(log_message.into()))
.await
.expect("Failed to send log message");
// TODO instead of sleeping here, once we handle ACK/NACK we should wait to get a NACK
// from the control channel
tokio::time::sleep(Duration::from_millis(5)).await;

However, this is fragile and actually seems to not work in windows:
https://github.com/open-telemetry/otel-arrow/actions/runs/20154182152/job/57898503464?pr=1594

We could update the test to wait to receive ACK or NACK before proceeding instead of relying on random sleeps. This would probably make the test more reliable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustPull requests that update Rust code

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions