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

Fix spurious test suite crashes related to tracing #3210

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/misc/tct-visualize/src/bin/tct-live-edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct Args {

#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let args = Args::parse();
let rng = rand::rngs::OsRng;

Expand Down
18 changes: 9 additions & 9 deletions crates/storage/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async fn delete_nonexistent_key() -> anyhow::Result<()> {
/// the next Storage::load() call is made. This is fixed by `Storage::release()`
/// which mimicks the behavior of an async drop (releasing resources).
async fn db_lock_is_released() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand All @@ -45,7 +45,7 @@ async fn db_lock_is_released() -> anyhow::Result<()> {

#[tokio::test]
async fn simple_flow() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

// Initialize an empty Storage in the new directory
Expand Down Expand Up @@ -803,7 +803,7 @@ async fn simple_flow() -> anyhow::Result<()> {
/// - queries with a prefix, a start key, and no end key
/// - queries with a prefix, no start key, and an end key
async fn range_queries_basic() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;
let storage = Storage::load(tmpdir.path().to_owned()).await?;

Expand Down Expand Up @@ -1134,7 +1134,7 @@ async fn range_queries_basic() -> anyhow::Result<()> {
#[tokio::test]
/// Test that overwrites work correctly, and that we can read the latest value.
async fn range_query_overwrites() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand All @@ -1151,7 +1151,7 @@ async fn range_query_overwrites() -> anyhow::Result<()> {
/// Test that inserting a value that precedes the peeked value works.
async fn range_query_prepend_peeked_value() -> anyhow::Result<()> {
use crate::StateWrite;
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand Down Expand Up @@ -1229,7 +1229,7 @@ async fn range_query_prepend_peeked_value() -> anyhow::Result<()> {
#[tokio::test]
/// Test that specifying an inverted range does not work.
async fn range_query_ordering() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand Down Expand Up @@ -1292,7 +1292,7 @@ async fn range_query_ordering() -> anyhow::Result<()> {
#[tokio::test]
/// Test that passing in an absurd range does not work.
async fn range_query_bad_range() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand Down Expand Up @@ -1322,7 +1322,7 @@ async fn range_query_bad_range() -> anyhow::Result<()> {
async fn range_query_storage_basic() -> anyhow::Result<()> {
use crate::read::StateRead;
use crate::write::StateWrite;
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand Down Expand Up @@ -1408,7 +1408,7 @@ async fn range_query_storage_basic() -> anyhow::Result<()> {
async fn range_query_storage() -> anyhow::Result<()> {
use crate::read::StateRead;
use crate::write::StateWrite;
tracing_subscriber::fmt::init();
let _ = tracing_subscriber::fmt::try_init();
let tmpdir = tempfile::tempdir()?;

let storage = Storage::load(tmpdir.path().to_owned()).await?;
Expand Down
Loading