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

Fixes random matrix:// unittest failures #1166

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Conversation

caronc
Copy link
Owner

@caronc caronc commented Jul 17, 2024

Description:

Related issue (if applicable): #1162

matrix:// unit tests fail randomly. Heavy kudos to @fabiottini for finding that it's random calls to logout().
image

image

Since the NotifyMatrix() Plugin attempts to automatically close any established connections when the object is removed from memory, the randomness kind of hints that it's the garbage collection that is kicking in and freeing up an unhandled object later on.

This PR ensures that the matrix:// object is safely removed from memory after each unit test which SHOULD prevent the randomness from occuring in the future.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@random-matrix-test-failures

# Test out the changes with the following command:
bin/test matrix

@caronc caronc merged commit ddb5b52 into master Jul 17, 2024
12 checks passed
@caronc caronc deleted the random-matrix-test-failures branch July 17, 2024 19:46
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.

1 participant