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

Fixes for compiling on macOS #1392

Merged
merged 1 commit into from
Dec 6, 2021
Merged
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
18 changes: 6 additions & 12 deletions linkerd/app/integration/src/tests/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,7 @@ mod transport {
async fn inbound_tcp_connect_err() {
let _trace = trace_init();
let srv = tcp::server()
.accept_fut(move |sock| {
drop(sock);
future::ok(())
})
.accept_fut(move |sock| async { drop(sock) })
.run()
.await;
let proxy = proxy::new().inbound(srv).run().await;
Expand All @@ -1213,7 +1210,7 @@ mod transport {
let tcp_client = client.connect().await;

tcp_client.write(TcpFixture::HELLO_MSG).await;
assert_eq!(tcp_client.read().await, &[]);
assert_eq!(tcp_client.read().await, &[] as &[u8]);
// Connection to the server should be a failure with the EXFULL error
metrics::metric("tcp_close_total")
.label("peer", "dst")
Expand All @@ -1233,15 +1230,12 @@ mod transport {
.await;
}

#[test]
#[tokio::test]
#[cfg(target_os = "macos")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hawkw do you recall why these tests are macOS-specific? should they instead be marked flakey so we can at least catch build failures? Do we really depend on some macOS specific behavior here, or are these tests just broken?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are macos-specific due to errno labels; some syscalls return different error codes on macos than on Linux, so the errno labels are different on macOS. the tests assert that a label is added for "whatever error code the OS returns": https://github.com/linkerd/linkerd2-proxy/pull/1392/files/92538c2c2764bd22802ad3db9eac676828f070d7#diff-22fea522d6f7f7482dc4554c9d57ffb7bb433c7dc1729ef93ed13864af712cb2R1254

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a potential alternative, we could just only test errno labels on Linux!

fn outbound_tcp_connect_err() {
async fn outbound_tcp_connect_err() {
let _trace = trace_init();
let srv = tcp::server()
.accept_fut(move |sock| {
drop(sock);
future::ok(())
})
.accept_fut(move |sock| async { drop(sock) })
.run()
.await;
let proxy = proxy::new().outbound(srv).run().await;
Expand All @@ -1252,7 +1246,7 @@ mod transport {
let tcp_client = client.connect().await;

tcp_client.write(TcpFixture::HELLO_MSG).await;
assert_eq!(tcp_client.read().await, &[]);
assert_eq!(tcp_client.read().await, &[] as &[u8]);
// Connection to the server should be a failure with the EXFULL error
metrics::metric("tcp_close_total")
.label("peer", "dst")
Expand Down