Skip to content

Support custom ResourceControlPolicy in integration tests#3505

Merged
jvff merged 5 commits intolinera-io:mainfrom
jvff:change-resource-policy-in-integration-tests
Mar 8, 2025
Merged

Support custom ResourceControlPolicy in integration tests#3505
jvff merged 5 commits intolinera-io:mainfrom
jvff:change-resource-policy-in-integration-tests

Conversation

@jvff
Copy link
Copy Markdown
Contributor

@jvff jvff commented Mar 8, 2025

Motivation

In integration tests, the ResourceControlPolicy was hardcoded to use the default value. With the addition of an HTTP allow list (#3427), the tests aren't able to test any HTTP requests.

Proposal

Allow changing the ResourceControlPolicy used inside a test, allowing to add hosts to the allow list. For the policy change to work, a new committee and epoch must be published. Therefore the epoch and committee can't be assumed to be constant anymore.

Test Plan

Wrote some (upcoming) tests that try to perform an HTTP request without changing the policy and after adding the host to the policy, and ensured that the former fails while the latter succeeds.

Release Plan

  • These changes follow the usual release cycle, because this will help with tests that use a feature that has not yet been released.

Links

jvff added 5 commits March 8, 2025 13:20
Prepare to allow tests to advance the epoch.
Remove the hard-coded initial epoch to allow proposing blocks after the
chain has advanced its epoch.
Place them inside shared `Mutex`es so that they can be updated.
Allow mutating a committee's [`ResourceControlPolicy`].
Allow tests to configure the `ResourceControlPolicy` used in the tests.
@jvff jvff added the enhancement New feature or request label Mar 8, 2025
@jvff jvff added this to the Testnet #2 milestone Mar 8, 2025
@jvff jvff requested review from afck, deuszx and ma2bd March 8, 2025 13:26
@jvff jvff self-assigned this Mar 8, 2025
@jvff jvff added this to Web3 SDK Mar 8, 2025
@jvff jvff merged commit 34e86f6 into linera-io:main Mar 8, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this to Done in Web3 SDK Mar 8, 2025
@jvff jvff deleted the change-resource-policy-in-integration-tests branch March 8, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants