Issue 2551125
Created on 2021-03-31 08:02 by schlatterbeck, last changed 2021-04-01 13:18 by rouilj.
msg7159 |
Author: [hidden] (schlatterbeck) |
Date: 2021-03-31 08:02 |
|
I'm seeing three failing tests in test/test_config.py with both, python2 and python3. Maybe the tests should be made conditional on installed Xapian?
I'm attaching a log of the failing tests
|
msg7160 |
Author: [hidden] (rouilj) |
Date: 2021-03-31 12:45 |
|
Ralf I just pushed changes:
First an last case get @skip_xapian o they only run if xapian
installed.
Second case gets a if 'xapian._xapian' in sys.modules' guard.
Can you test and close if this fixes the issue.
Thanks.
-- rouilj
|
msg7161 |
Author: [hidden] (rouilj) |
Date: 2021-03-31 13:38 |
|
Also added test case to verify that a bad indexer_lang doesn't
raise an exception if xapian is not installed. This only runs
if xapian isn't installed and duplicates a test that plays around with
sys.modules to simulate xapian as not installed.
|
msg7162 |
Author: [hidden] (schlatterbeck) |
Date: 2021-04-01 06:19 |
|
Two of the three failing tests are now skipped, thanks!
But the third one is still failing, log attached.
|
msg7163 |
Author: [hidden] (schlatterbeck) |
Date: 2021-04-01 07:01 |
|
I've pushed a fix, hope this is ok what I did.
Note that I *think* removing modules from sys.modules might affect following tests, as the loaded modules are probably no longer available?
|
msg7164 |
Author: [hidden] (rouilj) |
Date: 2021-04-01 13:18 |
|
Hi Ralf:
In message <1617260479.14.0.562086382424.issue2551125@roundup.psfhosted.org>,
Ralf Schlatterbeck writes:
>Ralf Schlatterbeck added the comment:
>
>I've pushed a fix, hope this is ok what I did.
Yup, that is exactly the right fix. xapian._xapian needed to be a
string. I didn't notice it in testing since my test platforms have
xapian installed/defined.
>Note that I *think* removing modules from sys.modules might affect
>following tests, as the loaded modules are probably no longer available?
If I delete a module/key from sys.modules[] the next import will put
it back. If I define the value of the module as None, the next import
will raise an ImportError.
The only import of xapian in roundup/configuration.py is within the
validator() method that is under test. So a deletion of the xapian
symbols from the sys.modules dict will be re-defined by the import
xapian statement in validator(). Defining the xapian symbol as None
before a call to import xapian will result in an ImportError
exception.
If the 'import xapian' was done at the module or class level in
configuration.py, you would be correct. I would need to do the delete
followed by an import xapian in the test to restore the module.
Also I have been running with pytest random-order to looks for order
dependencies (as would happen if the issue you raise was true) just
and haven't found any in about 100 runs.
I am considering adding it to the ci test so postgres/mysql also get
tested, but I test sqlite so I get most of the rdbms code tested.
Have a great week and thanks for the fix. I'll close this issue.
|
|
Date |
User |
Action |
Args |
2021-04-01 13:18:55 | rouilj | set | status: pending -> fixed resolution: fixed messages:
+ msg7164 |
2021-04-01 07:01:19 | schlatterbeck | set | messages:
+ msg7163 |
2021-04-01 06:19:04 | schlatterbeck | set | files:
+ failing-tests2.txt messages:
+ msg7162 |
2021-03-31 13:38:17 | rouilj | set | messages:
+ msg7161 |
2021-03-31 12:45:30 | rouilj | set | status: new -> pending versions:
+ devel messages:
+ msg7160 priority: normal assignee: rouilj type: crash |
2021-03-31 08:02:43 | schlatterbeck | create | |
|