#28444 closed New feature (wontfix)
Allow for different settings for each thread when testing with --parallel
Reported by: | Leonardo Arroyo | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm trying to run my tests in parallel and it mostly work fine, however, I'm testing an application which users haystack + whoosh and I end up getting a lock error from whoosh because multiple threads are trying to write to the same index.
It would be extremely useful if I could modify the settings for each thread, this way I can specify different whoosh indexes for each thread, much like django automatically handles multiple databases in parallel testing.
Change History (4)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Component: | Uncategorized → Testing framework |
---|---|
Type: | Uncategorized → New feature |
comment:3 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Or maybe your test settings file could make use of threading.get_ident() to construct the index name? Like Tom, I'm also not immediately convinced that this would be generally useful. Feel free to to put together a proof of concept and write to the DevelopersMailingList to see what others think.
comment:4 by , 7 years ago
I can't find the exact discussion (either here or on the mailing list) but this was discussed in the past. I think it was about using a different Redis databases per-process which is really similar to this issue.
This seems pretty specific, a better idea might be to submit a change to the
haystack
library to support giving callable values in the settings (then you can return a different index value per thread)?