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

Disable ImageExpirationPool during testing #4363

Merged

Conversation

dnsge
Copy link
Contributor

@dnsge dnsge commented Feb 9, 2023

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

When running tests on macOS, the program finishes with the following error:
libc++abi: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

This is caused by ImageExpirationPool which is indirectly being used in the Emojis.ShortcodeParsing test. When the emoji Image objects are destructed, they are removed from the ImageExpirationPool. Despite having a static lifetime, the ImageExpirationPool seems to have been destroyed before these Image objects, so the ImageExpirationPool's mutex is used after it has been destructed.

The simple solution is to just disable the ImageExpirationPool logic during tests.

@pajlada pajlada enabled auto-merge (squash) February 11, 2023 19:05
@pajlada pajlada merged commit cf80ae8 into Chatterino:master Feb 11, 2023
@dnsge dnsge deleted the fix/tests-image-expiration-pool-mutex-crash branch March 4, 2023 02:58
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