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

chore(katana): ignore forked backend thread spawn test #1977

Merged
merged 1 commit into from
May 16, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented May 16, 2024

Description

ignore test that checks if the backend thread is spawned or not, for now, as we have made sure (since #1944) that the thread will always be spawned when creating a new Backend:

pub fn new(provider: P, block_id: BlockHashOrNumber) -> Result<BackendHandle, BackendError> {
let (handle, backend) = Self::new_inner(provider, block_id);
thread::Builder::new()
.name("forking-backend".into())
.spawn(move || {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.expect("failed to create tokio runtime")
.block_on(backend);
})
.map_err(BackendError::BackendThreadInit)?;
info!(target: LOG_TARGET, "Forking backend started.");
Ok(handle)
}

currently the test is passing due to an error that was not being expected from the test. what the test was meant to do is to test that an error should happen if the BackendHandle is being used while the Backend is nonexistant/dropped.

but because the recent refactor in #1944, the end goal is to separate the thread spawning entirely out of the creation of the Backend. so that we can let the api consumer to handle how to drive the Backend future forward.

Related issue

Tests

  • Yes
  • No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed

Checklist

  • I've formatted my code (scripts/prettier.sh, scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.78%. Comparing base (de3b2e5) to head (5376514).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1977      +/-   ##
==========================================
- Coverage   69.80%   69.78%   -0.02%     
==========================================
  Files         313      313              
  Lines       35526    35527       +1     
==========================================
- Hits        24798    24793       -5     
- Misses      10728    10734       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

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

Thanks for this fix mate. 🙏

@kariy kariy merged commit 49f0a4e into dojoengine:main May 16, 2024
12 of 13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants