Comments (8)
I think maybe it happened when an instance of the process crashed and I ran it again. Anyway, if you can't reproduce then feel free to close the issue. ππ»
from console.
@zoechi For integration tests (or any tests that use tracing subscribers), you need to use set_default to set a thread local subscriber.
This is because cargo runs each test from a single integration test file in its own thread, but in the same executable and if each test tries to set a global subscriber they will clash (and panic as you saw).
It sounds like you're also spawning your own threads in your tests, in that case you need to set up a separate subscriber in each thread you create.
(this situation is a bit different from the original issue)
from console.
@mrcnski Thanks for your error report.
I couldn't reproduce this error with the following minimal project. Could you see if you can modify it to produce the error you see in polkadot?
Cargo.toml
:
[package]
name = "console-eyre"
version = "0.1.0"
edition = "2021"
[dependencies]
color-eyre = "0.6.2"
console-subscriber = "0.2.0"
eyre = "0.6.11"
src/main.rs
:
fn main() -> eyre::Result<()> {
console_subscriber::init();
color_eyre::install()?;
println!("Hello, world!");
Ok(())
}
I ran it with:
RUSTFLAGS="--cfg tokio_unstable" cargo run --release
from console.
Closing this as can't repro at request of original author @mrcnski.
from console.
I just run into this error when I run more than one integration test that invokes production code calling
tracing::subscriber::set_global_default(subscriber);
It was kinda hard to find because the code runs in a thread and the error was masked by another error just before join_handle.join()
from console.
Thanks for the infoπ
from console.
Related Issues (20)
- console_subscriber: "poll's start timestamp was before the wake time/last poll timestamp" HOT 2
- consider publishing using `cargo-dist`
- Add key to jump from an async op to the related task HOT 1
- `console-subscriber` crate has low test coverage
- Record `ExpectedTask` creation location in console-subscriber tests
- Don't send task names as strings HOT 3
- Flaky `console-subscriber` integration tests HOT 2
- Sorting does not work on all columns in the resources view HOT 2
- `tokio-console` won't quit when the main program has exit HOT 1
- Improve attributes sorting in the resources tab
- subscriber: add grpc-web support to console-subscriber HOT 4
- RUSTSEC-2021-0145: Potential unaligned read
- Console doesn't detect self wakes from `tokio::task::yield_now()` after Tokio 1.23 HOT 5
- Key presses happen twice on Windows HOT 4
- `blocking` and `block_on` tasks have false positive lints HOT 1
- Autodetection of new execution not always working
- Make better use of space in task detail screen HOT 1
- Format "last woken" time prettily HOT 4
- tokio::task::spawn_blocking() tasks show as 'warning: task has never yielded' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console.