Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
phpunit
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2015 at 07:32 UTC
Updated:
3 Oct 2015 at 15:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerWhat happens if you run this test via phpunit itself, which is the recommended way?
Comment #3
claudiu.cristeaWell, my real case needs access to db and files but I got this error while building the test from scratch. I wrote this fake test only to reveal this failure.
Comment #4
claudiu.cristeaHere's with phpunit:
Comment #5
claudiu.cristeaSetting the env var SIMPLETEST_DB to a valid connection string fixes the problem when running from command line. But it's still broken in UI.
Comment #6
claudiu.cristeaNow I'm getting another problem when adding modules.
this produces
Comment #7
dawehnerMaybe something like this?
Comment #8
claudiu.cristeaManually tested. This is fixing "Required prefix configuration is missing" error.
Comment #9
jibranI don't think we can really test this. I applied this locally and it fixes the issue for me.
Function doc block is missing.
Comment #10
claudiu.cristeaI tried also to add a test for that but no luck.
I guess the only thing needed here is to move that comment to a doc block.
Comment #11
jibranThanks for the fix. It's RTBC.
Comment #12
alexpottBefore we add any more KTBTNG's we need to fix https://www.drupal.org/node/2553533 - each new test added increases the chance of random fail due to test id reuse.
Comment #13
neclimdul#2553533: KernelTestBaseTNG™ is not cleaning up after itself is in and did a once over and this looks mostly ok with me and it does fix it but not sure about this.
Do we want to reset these values each time we get a list of extensions? Currently the 2 places we call it we do need to initialize filecache but I'm not sure that is an appropriate assumption to build into the method.
Comment #14
dawehnerI think yeah we should avoid any sideeffects if possible. Pratically it doesn't matter at the moment because we use process isolation but still ... once we might get rid of it, its better to avoid it.
Comment #15
neclimdulWell my point was its not a clear side effect of the function. We are in fact introducing a side effect by changing the value.
Comment #16
geertvd commentedI noticed this needed a reroll while working on #2556855: Port ViewKernelTestBase to extend from KernelTestBaseTNG™
Comment #17
dawehnerWe should reset in tearDown() ...
Comment #18
claudiu.cristea@dawehner, I see no reset/wipe method on FileCache or FileCacheFactory. Or should we use somehow a __destruct() method?
Comment #19
dawehnerWell, then FileCache should get one ...
Comment #20
claudiu.cristeaNot sure I got the idea :)
Comment #22
dawehnerWell actually I thought about a reset() method which just resets
\Drupal\Component\FileCache\FileCache::$cachedComment #23
geertvd commentedSimply this then. Interdiff is from #16
Comment #25
geertvd commentedComment #26
geertvd commentedComment #27
neclimdulSeems like we could move this to setUp() to match the reset in teardown. Not tied to this since dawehner seems to like it where it is but it still makes sense to me. Other then that, if a FileCache maintainer signs of on the new method I think we're good.
Comment #28
dawehnerIMHO you don't need to add a static function to an interface.
I like the idea to move it to setup() itself.
Comment #29
xanoI also replaced string FQNs with
::classusages.Comment #30
neclimdulWFM. Thanks for putting up with my nit-picks guys.
Comment #33
geertvd commentedSeems like a random fail, setting back to rtbc
Comment #35
geertvd commentedThese are different fails then the ones before, so i'm retesting this again.
Comment #38
geertvd commentedNot sure why this is failing, EntityFileTest extends KernelTestBase but not KernelTestBaseTNG
Comment #39
borisson_The test failures of
EntityFileTestare the same here as they are in in #2358319: Alt tag missing on user images, so I don't think these are related to this patch.Comment #40
dawehner#2562453: EntityFileTest fails randomly is an issue for that.
Comment #41
geertvd commentedAs mentioned in some other tickets, there was also an issue with bot 3128 which was running these failing tests. Since it's been taking out of rotation it should pass again now.
Comment #43
geertvd commentedSetting back to RTBC as per #30
Comment #44
alexpottWhy do we need the reset? Each KernelTestBase is run inside it's own process.
Comment #45
dawehnerI hope we don't assume that.
Comment #46
alexpott@dawehner of course we assume that - in order to run KernelTestBaseTNG in the same process we have to remove all procedural code from Drupal.
Comment #47
neclimdulI guess the point is, every time we build that assumption in we add one more hurdle to not having that assumption. Which isn't to say we are going to remove all the procedural code from Drupal, just that at some point we might have tests opt in to running in a separate process rather then that being the default or something like that. It seems like cleaning up is just the right thing to do.
Comment #48
xanoAgreed with @dawehner and @neclimdul.
I am curious though as to why different
FileCacheinstances share the same static property for caching data.Comment #49
dawehnerBut we should try to remove the surface area of problems as much as possible. If we know about this static cache, we should clear it.
Comment #50
neclimdulI think concerns have been addressed so going to put this back RTBC.
Comment #51
claudiu.cristeaNit: We are initializing the
FileCache, not theFileCacheFactory.Added Issue Summary and Beta Evaluation.
Comment #52
claudiu.cristeaComment #53
neclimdulThat's fair. We are just using the factory to do it. Better docs, still RTBC.
Comment #56
neclimdulGET http://ec2-54-191-149-30.us-west-2.compute.amazonaws.com/checkout/test-d... returned 0 (0 bytes)
Comment #59
claudiu.cristeaComment #60
dawehnerLet it be green while its green.
Comment #61
alexpottSo this is completely lacking tests which is a shame. All we need to do is change
\Drupal\system\Tests\Extension\ModuleHandlerTestto install system and change testModuleList() to start with the system module in the list.And I'm still not a fan of the reset. It solves the issue in one place whereas we actually have more instances of this. What we need is a drupal_static() for classes - there is an issue for this somewhere. Can an @todo be added to remove this once that is done.
Comment #62
dawehnerThere we go
Comment #64
neclimdultestbot....
GET http://ec2-54-186-69-54.us-west-2.compute.amazonaws.com/checkout/user/login returned 0
Comment #66
neclimdullike it.
Comment #67
alexpottCommitted 0f8b5b1 and pushed to 8.0.x. Thanks!