Skip to content

tests: Mock arweave resolver to fix flaky arweave_file_data_sources test#6363

Open
lutter wants to merge 1 commit intomasterfrom
lutter/arw-test
Open

tests: Mock arweave resolver to fix flaky arweave_file_data_sources test#6363
lutter wants to merge 1 commit intomasterfrom
lutter/arw-test

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Feb 13, 2026

The test relied on real HTTP calls to arweave.net and a 1500ms sleep hack to work around the resulting race condition. Replace with a StaticArweaveResolver that returns synthetic content from memory, making the test deterministic and faster.

Also generalize arweave_service() to accept Arc<dyn ArweaveResolver> instead of Arc<ArweaveClient>, and ensure setup_inner uses a single resolver instance for both the polling service and TestContext.

The test relied on real HTTP calls to arweave.net and a 1500ms sleep
hack to work around the resulting race condition. Replace with a
StaticArweaveResolver that returns synthetic content from memory,
making the test deterministic and faster.

Also generalize arweave_service() to accept Arc<dyn ArweaveResolver>
instead of Arc<ArweaveClient>, and ensure setup_inner uses a single
resolver instance for both the polling service and TestContext.
Copy link
Member

@dimitrovmaksim dimitrovmaksim left a comment

Choose a reason for hiding this comment

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

LGTM. The only nit I had initially was the use of ArweaveClientError::UnableToCheckFileSize error variant in get_with_limit, but it seems there isn't another option, with Unknown being too ambiguous.

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