Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
tests
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2008 at 04:35 UTC
Updated:
8 Jul 2008 at 23:32 UTC
The tests for the aggregator module use the site's own rss.xml feed as test data. When running the test on a vanilla install, there is no content and the tests run without problem. However, if you create content first, the three tests "Update/remove/categorize feed items" fail at the assertion Total items in feed equal to the total items in database (0 != 10).
The problem is that we are comparing the number of entries in simpletest766557node which is always empty when running the test, with simpletest766557aggregator_item which is populated with data from node instead of simpletest766557node.
Comments
Comment #1
webchickComment #2
webchickComment #3
boombatower commentedIt appears the test uses all
drupalGetcalls which use the database prefix and any queries the test executes should as well.Not sure why the pre-existing content would affect it.
Comment #4
boombatower commentedI tried this today and it didn't occur.
This may have been fixed, can someone else confirm.
Comment #5
webchickI also couldn't confirm this the other day (although I could originally on the dates when I changed the issue statuses). Perhaps something went in that fixed it.
I'm going to mark this closed for now. If it pops up again, I'll re-open it.
Comment #6
boombatower commentedyea :)
Comment #7
webchickShoot.
Just marked #266521: aggregator test has failures as a dupe of this today, and I can reproduce it again now too.
I'm going to try and nail down some specific instructions for reproducing this.
Comment #8
webchickOk, it's actually really quite simple.
Do a fresh install of HEAD.
Run the test. Test passes successfully.
Create a node. Mine was an article, but I doubt it matters.
Run the test again. Test fails.
This would explain why some are getting inconsistent results, if we're trying it on totally clean installs in order to eliminate other potential problems.
Comment #9
webchickHm. I don't understand the point of this test?
I just enabled Aggregator module, added a couple feeds, updated the feed items, and looked at rss.xml. It only lists my node, not any aggregator feed items.
Is the test itself brain-dead, or is it me? :D
Comment #10
catchAs I understand it - it creates a node, pulls the test site's own rss.xml feed into aggregator as a feed (which should contain just the one node we created), then compares the feed items in the aggregator tables to the number of real nodes in the database - these should be the same because the site is aggregating itself. It's a bit weird, but it kinda makes sense, I think. But, shouldn't the node creation go in setUp() or something?
Comment #11
floretan commentedThis line of the test:
eventually leads to a call to aggregator_refresh(), which relies on drupal_http_request() to get the feed information. As it is now, drupal_http_request() does not transmit the database prefix, which is why we get content from the non-test website. #260778: Add SimpleTest user agent information to drupal_http_request should fix this.
After this issue with drupal_http_request() is solved, we should also create some nodes before running the tests. A feed with no items is no good for testing purposes (a random number of items would be better).
Comment #12
catchMarking as postponed since #260778 fixes this.
Comment #13
boombatower commented#260778: Add SimpleTest user agent information to drupal_http_request fixed this.
Comment #14
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.