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

Cleaning state pollution in si_app #1

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

Conversation

sturmianseq
Copy link

This PR aims to improve test reliability of test test_plugin_hdfs_add by cleaning state pollution in si_app by deleting data source and clearing data_source_dict

The test can fail in this way by running pip3 install pytest-repeat; python3 -m pytest --count=2 test/test_plugin_mysql_hdfs.py::test_plugin_hdfs_add:

    def test_plugin_hdfs_add():
        si_app.delete_data_soruce(hdfs_ds_dict)
        dict1 = si_app.get_data_source_dict(ds_name=hdfs_ds_dict['ds_name'])
>       assert dict1 is None
E       AssertionError: assert {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x7fd7bfbe38b0>, 'created_date': datetime.datetime(2021, 8, 25, 2, 14, 1), 'ds_desc': 'created by unittest of hdfsindex', 'ds_name': 'hdfs1', ...} is None

Such failure occurs while running on test_plugin_mysql_add, and can be fixed in the same way.

It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state pollution.

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.

None yet

1 participant