-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix reorg threshold bug #5804
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 reorg threshold bug #5804
Changes from all commits
7f2f7a6
9952e77
51023d2
4c21ffe
8838954
6f56c3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ use graph::data::store::scalar::Bytes; | |
use graph::data::subgraph::schema::{SubgraphError, SubgraphHealth}; | ||
use graph::data::value::Word; | ||
use graph::data_source::CausalityRegion; | ||
use graph::env::EnvVars; | ||
use graph::env::{EnvVars, TEST_WITH_NO_REORG}; | ||
use graph::ipfs; | ||
use graph::ipfs::test_utils::add_files_to_local_ipfs_node_for_testing; | ||
use graph::object; | ||
|
@@ -109,6 +109,8 @@ fn assert_eq_ignore_backtrace(err: &SubgraphError, expected: &SubgraphError) { | |
|
||
#[tokio::test] | ||
async fn data_source_revert() -> anyhow::Result<()> { | ||
*TEST_WITH_NO_REORG.lock().unwrap() = true; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not entirely sure if these tests are run in parallel or not. But it might be better to reset There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current behaviour is that all test have reorg threshold set to 0. But yeah I reset it after the end of test. |
||
let RunnerTestRecipe { stores, test_info } = | ||
RunnerTestRecipe::new("data_source_revert", "data-source-revert").await; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty minor, but AFAICT, we only need the ability to override the reorg threshold when debug assertions is on. Could we therefore have a variant of this function for
#[cfg(not(debug_assertions))]
that doesn't touch the mutex?