Bug 100678

Summary: [WTR] WebKitTestRunner is not cleaning up the icon database
Product: WebKit Reporter: Thiago Marcos P. Santos <tmpsantos>
Component: Tools / TestsAssignee: Thiago Marcos P. Santos <tmpsantos>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, beidson, cdumez, kenneth, mikhail.pozdnyakov, ossy, rakuco, webkit.review.bot, zoltan.nyul
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 102616    
Bug Blocks: 100346, 101182    
Attachments:
Description Flags
Patch
none
Patch none

Thiago Marcos P. Santos
Reported 2012-10-29 08:36:01 PDT
The icon database is not being set to the temporary folder created for the test runner by the test driver, which is removed automatically after the run.
Attachments
Patch (1.95 KB, patch)
2012-10-30 05:29 PDT, Thiago Marcos P. Santos
no flags
Patch (2.13 KB, patch)
2012-10-31 04:20 PDT, Thiago Marcos P. Santos
no flags
Thiago Marcos P. Santos
Comment 1 2012-10-30 05:29:20 PDT
Brady Eidson
Comment 2 2012-10-30 05:52:34 PDT
Comment on attachment 171426 [details] Patch DId you test this on multiple platforms?
Kenneth Rohde Christiansen
Comment 3 2012-10-30 05:56:47 PDT
Comment on attachment 171426 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171426&action=review > Tools/WebKitTestRunner/TestController.cpp:334 > +#if OS(WINDOWS) > + const char separator = '\\'; > +#else > + const char separator = '/'; > +#endif > + iconDatabaseFileTemp = iconDatabaseFileTemp + separator + "WebpageIcons.db"; > + WKRetainPtr<WKStringRef> iconDatabaseFileTempWK = WKStringCreateWithUTF8CString(iconDatabaseFileTemp.c_str()); Really? WebCore has methods for doing these things, look in FileSystem.h
Thiago Marcos P. Santos
Comment 4 2012-10-30 06:32:59 PDT
Comment on attachment 171426 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171426&action=review >> Tools/WebKitTestRunner/TestController.cpp:334 >> + WKRetainPtr<WKStringRef> iconDatabaseFileTempWK = WKStringCreateWithUTF8CString(iconDatabaseFileTemp.c_str()); > > Really? WebCore has methods for doing these things, look in FileSystem.h I would love to use pathByAppendingComponent here, but we can't use the namespace here. I had to do the same way as Tools/WebKitTestRunner/TestInvocation.cpp
Kenneth Rohde Christiansen
Comment 5 2012-10-30 06:37:12 PDT
(In reply to comment #4) > (From update of attachment 171426 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=171426&action=review > > >> Tools/WebKitTestRunner/TestController.cpp:334 > >> + WKRetainPtr<WKStringRef> iconDatabaseFileTempWK = WKStringCreateWithUTF8CString(iconDatabaseFileTemp.c_str()); > > > > Really? WebCore has methods for doing these things, look in FileSystem.h > > I would love to use pathByAppendingComponent here, but we can't use the namespace here. I had to do the same way as Tools/WebKitTestRunner/TestInvocation.cpp Maybe it is time we move FileSystem.h to WTF. This is not the first case.
Kenneth Rohde Christiansen
Comment 6 2012-10-30 06:37:41 PDT
Comment on attachment 171426 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171426&action=review r=me then > Tools/WebKitTestRunner/TestController.cpp:328 > +#if OS(WINDOWS) Add a comment why not using pathByAppending...
Thiago Marcos P. Santos
Comment 7 2012-10-31 02:48:39 PDT
(In reply to comment #2) > (From update of attachment 171426 [details]) > DId you test this on multiple platforms? I tested it on Linux only with the following ports: Qt, GTK and EFL.
Thiago Marcos P. Santos
Comment 8 2012-10-31 04:20:36 PDT
WebKit Review Bot
Comment 9 2012-10-31 07:02:04 PDT
Comment on attachment 171615 [details] Patch Clearing flags on attachment: 171615 Committed r133024: <http://trac.webkit.org/changeset/133024>
WebKit Review Bot
Comment 10 2012-10-31 07:02:08 PDT
All reviewed patches have been landed. Closing bug.
Raphael Kubo da Costa (:rakuco)
Comment 11 2012-11-01 08:56:52 PDT
This patch is causing random crashes at least on the EFL port. See, for example, <http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Debug%20WK2/builds/5289/steps/layout-test/logs/stdio>. WKContextSetIconDatabasePath() sets a database path, but when we later create our ewk view the call to Ewk_Context::faviconDatabase() ends up calling it again and reaching the assertion in IconDatabase's destructor.
Thiago Marcos P. Santos
Comment 12 2012-11-01 09:16:08 PDT
(In reply to comment #11) > This patch is causing random crashes at least on the EFL port. See, for example, <http://build.webkit.org/builders/EFL%20Linux%2064-bit%20Debug%20WK2/builds/5289/steps/layout-test/logs/stdio>. > > WKContextSetIconDatabasePath() sets a database path, but when we later create our ewk view the call to Ewk_Context::faviconDatabase() ends up calling it again and reaching the assertion in IconDatabase's destructor. This is probably EFL specific. We should create a separated bug for that.
Chris Dumez
Comment 13 2012-11-01 09:19:34 PDT
Comment on attachment 171615 [details] Patch Why not use IconDatabase::removeAllIcons() to clear the database instead of messing with the path?
Thiago Marcos P. Santos
Comment 14 2012-11-01 09:38:55 PDT
(In reply to comment #13) > (From update of attachment 171615 [details]) > Why not use IconDatabase::removeAllIcons() to clear the database instead of messing with the path? Nobody is "messing with the paths" here. The WTR was creating folders on your computer for every run and not deleting them afterwards. This is what this patch is fixing, by making WTR handle the icon database path in the same way as it does for local storage, database, cookies, etc
Chris Dumez
Comment 15 2012-11-01 09:44:45 PDT
(In reply to comment #14) > (In reply to comment #13) > > (From update of attachment 171615 [details] [details]) > > Why not use IconDatabase::removeAllIcons() to clear the database instead of messing with the path? > > Nobody is "messing with the paths" here. The WTR was creating folders on your computer for every run and not deleting them afterwards. This is what this patch is fixing, by making WTR handle the icon database path in the same way as it does for local storage, database, cookies, etc Well, this is not the way EFL / GTK ports have done this so far. We are using XDG paths for databases and config. We usually just override the XDG environment variable in the test runner python script: Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py: environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache') We should probably override the 'XDG_DATA_HOME' environment variable to achieve the expected behavior on EFL and GTK ports.
Thiago Marcos P. Santos
Comment 16 2012-11-01 10:03:48 PDT
(In reply to comment #15) > (In reply to comment #14) > > (In reply to comment #13) > > > (From update of attachment 171615 [details] [details] [details]) > > > Why not use IconDatabase::removeAllIcons() to clear the database instead of messing with the path? > > > > Nobody is "messing with the paths" here. The WTR was creating folders on your computer for every run and not deleting them afterwards. This is what this patch is fixing, by making WTR handle the icon database path in the same way as it does for local storage, database, cookies, etc > > Well, this is not the way EFL / GTK ports have done this so far. We are using XDG paths for databases and config. We usually just override the XDG environment variable in the test runner python script: > > Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py: environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache') > > We should probably override the 'XDG_DATA_HOME' environment variable to achieve the expected behavior on EFL and GTK ports. No, we should not. If you "fix" this on xvfbdriver.py, if you happen to use another driver at some point, you will have to move these hacks around. If Chromium or Qt decides to use the xvfbdriver, they might get some unexpected behavior because of these variables on the system environment. The only reason why we still have XDG_CACHE_HOME on the driver (I removed the others and fixed the XDG_CACHE_HOME - bug 100864 and bug 100864) is because we don't have an WK2 API for setting the application cache folder yet. Please, let's keep the drivers and WTR platform neutral and EFL aligned with other ports.
Chris Dumez
Comment 17 2012-11-01 10:17:16 PDT
(In reply to comment #16) > (In reply to comment #15) > > (In reply to comment #14) > > > (In reply to comment #13) > > > > (From update of attachment 171615 [details] [details] [details] [details]) > > > > Why not use IconDatabase::removeAllIcons() to clear the database instead of messing with the path? > > > > > > Nobody is "messing with the paths" here. The WTR was creating folders on your computer for every run and not deleting them afterwards. This is what this patch is fixing, by making WTR handle the icon database path in the same way as it does for local storage, database, cookies, etc > > > > Well, this is not the way EFL / GTK ports have done this so far. We are using XDG paths for databases and config. We usually just override the XDG environment variable in the test runner python script: > > > > Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py: environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache') > > > > We should probably override the 'XDG_DATA_HOME' environment variable to achieve the expected behavior on EFL and GTK ports. > > No, we should not. If you "fix" this on xvfbdriver.py, if you happen to use another driver at some point, you will have to move these hacks around. If Chromium or Qt decides to use the xvfbdriver, they might get some unexpected behavior because of these variables on the system environment. > > The only reason why we still have XDG_CACHE_HOME on the driver (I removed the others and fixed the XDG_CACHE_HOME - bug 100864 and bug 100864) is because we don't have an WK2 API for setting the application cache folder yet. > > Please, let's keep the drivers and WTR platform neutral and EFL aligned with other ports. I see. The issue is that the database path can only be set once. If you set it in WKTR then we can no longer set it in WebKit2 EFL. We would probably need to expose a settings API to set the database path and let the application take care of it. Right?
Csaba Osztrogonác
Comment 18 2012-11-04 04:13:44 PST
*** Bug 99448 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.