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

unit test fails: axum::routing::tests::logging_rejections #2385

Closed
1 task done
jbethune opened this issue Nov 30, 2023 · 1 comment
Closed
1 task done

unit test fails: axum::routing::tests::logging_rejections #2385

jbethune opened this issue Nov 30, 2023 · 1 comment

Comments

@jbethune
Copy link

  • I have looked for existing issues (including closed) about this

Bug Report

Version

Latest checkout from today (30.11.2023) 3c7cf81

cargo tree | grep axum gives me

axum v0.7.1 (/tmp/axum-main/axum)
├── axum-core v0.4.0 (/tmp/axum-main/axum-core)
│   ├── axum v0.7.1 (/tmp/axum-main/axum) (*)
│   ├── axum-extra v0.9.0 (/tmp/axum-main/axum-extra)
│   │   ├── axum v0.7.1 (/tmp/axum-main/axum) (*)
│   │   ├── axum-core v0.4.0 (/tmp/axum-main/axum-core) (*)
│   │   ├── axum-macros v0.4.0 (proc-macro) (/tmp/axum-main/axum-macros)
│   │   │   ├── axum v0.7.1 (/tmp/axum-main/axum) (*)
│   │   │   ├── axum-extra v0.9.0 (/tmp/axum-main/axum-extra) (*)
│   │   ├── axum v0.7.1 (/tmp/axum-main/axum) (*)
├── axum-macros v0.4.0 (proc-macro) (/tmp/axum-main/axum-macros) (*)
├── axum-macros v0.4.0 (proc-macro) (/tmp/axum-main/axum-macros) (*)
axum-core v0.4.0 (/tmp/axum-main/axum-core) (*)
axum-extra v0.9.0 (/tmp/axum-main/axum-extra) (*)
axum-macros v0.4.0 (proc-macro) (/tmp/axum-main/axum-macros) (*)

Platform

Linux box 6.6.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 29 Nov 2023 00:37:40 +0000 x86_64 GNU/Linux

Description

running cargo test from a fresh git clone gives me:

---- routing::tests::logging_rejections stdout ----
Listening on 127.0.0.1:35241
[axum/src/routing/tests/mod.rs:1013] events = []
thread 'routing::tests::logging_rejections' panicked at axum/src/routing/tests/mod.rs:1012:5:
assertion `left == right` failed
  left: []
 right: [TracingEvent { fields: RejectionEvent { message: "rejecting request", status: 500, body: "Missing request extension: Extension of type `core::convert::Infallible` was not found. Perhaps you forgot to add it? See `axum::Extension`.", rejection_type: "axum::extract::rejection::MissingExtension" }, target: "axum::rejection", level: "TRACE" }, TracingEvent { fields: RejectionEvent { message: "rejecting request", status: 400, body: "Request body didn't contain valid UTF-8: invalid utf-8 sequence of 1 bytes from index 1", rejection_type: "axum_core::extract::rejection::InvalidUtf8" }, target: "axum::rejection", level: "TRACE" }]

The corresponding unit test is fairly complex. left is an empty list but it should contain 2 tracing events.

@davidpdrsn
Copy link
Member

Include —all-features and it’ll pass.

@davidpdrsn davidpdrsn closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants