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 tests which upgrade multiple protocol versions at once #12328

Open
jancionear opened this issue Oct 28, 2024 · 0 comments
Open

Fix tests which upgrade multiple protocol versions at once #12328

jancionear opened this issue Oct 28, 2024 · 0 comments
Labels
A-testing Area: Unit testing / integration testing

Comments

@jancionear
Copy link
Contributor

jancionear commented Oct 28, 2024

Protocol upgrades should always be done between successive protocol versions, upgrading from X to X+1 is fine, but X to X+10 is not supported.

We have multiple tests which perform an upgrade from version X directly to the latest version. It'd be good to fix them so that they don't perform unsupported operations. It causes issues when trying to write new protocol upgrade code that should be able to rely on the fact that the upgrade will be performed from the previous protocol version, not one far in the past.

Here are some bad tests that I ran into when trying to implement bandwidth scheduler protocol upgrade:

integration-tests tests::client::features::account_id_in_function_call_permission::test_account_id_in_function_call_permission_upgrade
integration-tests tests::client::features::congestion_control::test_protocol_upgrade_simple
integration-tests tests::client::features::congestion_control::test_protocol_upgrade_under_congestion
integration-tests tests::client::features::flat_storage::test_flat_storage_upgrade
integration-tests tests::client::features::increase_deployment_cost::test_deploy_cost_increased
integration-tests tests::client::features::increase_storage_compute_cost::test_non_storage
integration-tests tests::client::features::increase_storage_compute_cost::test_non_storage_gas_exceeded
integration-tests tests::client::features::increase_storage_compute_cost::test_storage_remove
integration-tests tests::client::features::increase_storage_compute_cost::test_storage_write
integration-tests tests::client::features::increase_storage_compute_cost::test_storage_write_gas_exceeded
integration-tests tests::client::features::lower_storage_key_limit::protocol_upgrade
integration-tests tests::client::features::nearvm::test_nearvm_upgrade
integration-tests tests::client::features::zero_balance_account::test_zero_balance_account_upgrade

It looks like most of them use TestEnv::upgrade_protocol_to_latest_version(). We should fix it to allow upgrading to a specific version. Refs: #8590

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: Unit testing / integration testing
Projects
None yet
Development

No branches or pull requests

1 participant