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 reorg threshold bug #5804

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

zorancv
Copy link
Contributor

@zorancv zorancv commented Feb 6, 2025

No description provided.

@zorancv zorancv force-pushed the zoran/fix-reorg-threshold-bug branch from 3c10aba to 51023d2 Compare February 11, 2025 12:03
@zorancv zorancv force-pushed the zoran/fix-reorg-threshold-bug branch from a313261 to 4c21ffe Compare February 11, 2025 18:03
@zorancv zorancv marked this pull request as ready for review February 13, 2025 09:21
@zorancv zorancv requested a review from lutter February 13, 2025 14:27
Copy link
Collaborator

@lutter lutter left a comment

Choose a reason for hiding this comment

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

Nice!

} else {
self.reorg_threshold
}
}
Copy link
Collaborator

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?

@@ -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;

Copy link
Collaborator

Choose a reason for hiding this comment

The 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 TEST_WITH_NO_REORG after this test is done.

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