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

Travis: test flickering #341

Closed
agraul opened this issue Jun 16, 2018 · 2 comments · Fixed by #346
Closed

Travis: test flickering #341

agraul opened this issue Jun 16, 2018 · 2 comments · Fixed by #346
Labels

Comments

@agraul
Copy link
Member

agraul commented Jun 16, 2018

There is one test that fails sometimes. Triggering a rerun of travis often gets the test to pass. This happens in many PRs and while this is not news to some of us, I want to have it documented here so everyone can know about it 😃

Quoting Duncan:

We do have one system test that fails intermittently, and I believe it has to do with the way the ActiveXML library assembles queries for substrings when there are - in the string.

You can reproduce it with:

while bundle exec rails test test/system/search_results_test.rb; do :; done

until it fails.

I have spent some time looking and it and it is the only showstopper to enable auto-deploy.

@dmacvicar
Copy link
Member

The problem comes from the test that simulates an "nvidia" search.
That test stubs a random result based on packages named like the search term plus some random suffix.

That stub mocks the http call on a search by substring, as we do expect the search to hit https://github.com/openSUSE/software-o-o/blob/master/app/models/seeker.rb#L29

However, sometimes, the search hits https://github.com/openSUSE/software-o-o/blob/master/app/models/seeker.rb#L32 , which happens for terms specified with quotes, which results in a exact match being issued, which is not stubbed by our tests.

The only places where such search happens, is:

Giving that the first usage is in the search results (

if( appdata_pkg.blank? || appdata_pkg.first[:summary].blank? )
) I would suspect from this code. It looks for the exact package in oder to get the description to show in the card. I would expect this call to happen all the time.

So a way of fixing it would be to stub the search for every subpackage based on exact match. However, I would still be puzzled on why it happens sometimes.

@dmacvicar
Copy link
Member

I have a fix that stubs the missing query, however this code path comes directly from hell.

The code is calling:

GET https://api.opensuse.org/search/published/binary/id?match=@name%20=%20'nvidia-adipisci'%20

And the stub is

stub_request(:get, \"https://api.opensuse.org/search/published/binary/id?match=@name%20=%20'nvidia-adipisci'\")

And here is the culprit of that space:

xpath_items << "@name = '#{word.gsub(/['"()]/, "")}' "

Which seems to be a totally out of place space, as then the items are joined, not concatenated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants