Don't assert human error message in TestAsyncUpload (de-flake)
#839
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't assert human
errormessage inTestAsyncUpload(de-flake).As a general rule, we should not be asserting the language of human
errormessages. They can change at any time, localized, etc.This is spawning from a real life flaky failure I'm seeing when testing with the workers variant of Synapse:
$ WORKERS=1 COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh ./tests/csapi -run TestAsyncUpload/Cannot_upload_to_a_media_ID_that_has_already_been_uploaded_to ... === NAME TestAsyncUpload/Cannot_upload_to_a_media_ID_that_has_already_been_uploaded_to media_async_uploads_test.go:68: MatchResponse key 'error' got 'Media ID cannot be overwritten' (type string) want 'Media ID already has content' (type string) - http://127.0.0.1:33651/_matrix/media/v3/upload/hs1/GjRDDFucigeiLQtzNbjADIoI => {"errcode":"M_CANNOT_OVERWRITE_MEDIA","error":"Media ID cannot be overwritten"} 2026/01/22 17:05:44 ============================================ --- FAIL: TestAsyncUpload (14.13s) --- FAIL: TestAsyncUpload/Cannot_upload_to_a_media_ID_that_has_already_been_uploaded_to (0.07s) FAIL FAIL github.com/matrix-org/complement/tests/csapi 16.063s FAILI also see this test listed in the known flakes we track with Synapse: element-hq/synapse#18537
This problem happens because there are two possible error messages in Synapse which we could encounter for
M_CANNOT_OVERWRITE_MEDIA:"Media ID already has content""Media ID cannot be overwritten"Dev notes
How to run in
element-hq/synapse-rust-apps:Pull Request Checklist