Bug 229032

Summary: [GTK] Simplify TestWebKitAccessibility
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, bugs-noreply, ews-watchlist, gyuyoung.kim, mcatanzaro, mcrha, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: Gtk, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch mcatanzaro: review+

Description Carlos Garcia Campos 2021-08-12 04:04:22 PDT
We don't really need to have a different process to test a11y. We can remove AccessibilityTestServer and use the same test executable. That way we don't need to spawn a process and use DBus for the communication.
Comment 1 Carlos Garcia Campos 2021-08-12 04:09:00 PDT
Created attachment 435413 [details]
Patch
Comment 2 Carlos Garcia Campos 2021-08-12 04:15:40 PDT
Created attachment 435414 [details]
Patch
Comment 3 Michael Catanzaro 2021-08-12 06:26:38 PDT
Comment on attachment 435414 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=435414&action=review

Heh, nice!

> Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:41
> +        // We can get warnings from atspi when trying to connect to applications.
> +        Test::removeLogFatalFlag(G_LOG_LEVEL_WARNING);
>          int childCount = atspi_accessible_get_child_count(desktop.get(), nullptr);
> +        Test::addLogFatalFlag(G_LOG_LEVEL_WARNING);

What sort of warnings?

Certainly not failing the test is good to do, but they probably pollute the test log, don't they?
Comment 4 Carlos Garcia Campos 2021-08-12 06:48:33 PDT
(In reply to Michael Catanzaro from comment #3)
> Comment on attachment 435414 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=435414&action=review
> 
> Heh, nice!
> 
> > Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:41
> > +        // We can get warnings from atspi when trying to connect to applications.
> > +        Test::removeLogFatalFlag(G_LOG_LEVEL_WARNING);
> >          int childCount = atspi_accessible_get_child_count(desktop.get(), nullptr);
> > +        Test::addLogFatalFlag(G_LOG_LEVEL_WARNING);
> 
> What sort of warnings?
>

(TestWebKitAccessibility:23612): dbind-WARNING **: 09:35:59.141: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1001/at-spi2-12MT70/socket: No such file or directory

> Certainly not failing the test is good to do, but they probably pollute the
> test log, don't they?

It happens once, it seems related to a specific app, it also happens when starting accerciser.
Comment 5 Carlos Garcia Campos 2021-08-12 06:53:54 PDT
Committed r280966 (240472@main): <https://commits.webkit.org/240472@main>
Comment 6 Radar WebKit Bug Importer 2021-08-12 06:54:17 PDT
<rdar://problem/81846710>
Comment 7 Carlos Garcia Campos 2021-08-13 02:18:39 PDT
(In reply to Carlos Garcia Campos from comment #4)
> (In reply to Michael Catanzaro from comment #3)
> > Comment on attachment 435414 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=435414&action=review
> > 
> > Heh, nice!
> > 
> > > Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:41
> > > +        // We can get warnings from atspi when trying to connect to applications.
> > > +        Test::removeLogFatalFlag(G_LOG_LEVEL_WARNING);
> > >          int childCount = atspi_accessible_get_child_count(desktop.get(), nullptr);
> > > +        Test::addLogFatalFlag(G_LOG_LEVEL_WARNING);
> > 
> > What sort of warnings?
> >
> 
> (TestWebKitAccessibility:23612): dbind-WARNING **: 09:35:59.141: AT-SPI:
> Unable to open bus connection: Failed to connect to socket
> /run/user/1001/at-spi2-12MT70/socket: No such file or directory
> 
> > Certainly not failing the test is good to do, but they probably pollute the
> > test log, don't they?
> 
> It happens once, it seems related to a specific app, it also happens when
> starting accerciser.

It turned out to be evolution that is replying to atspi GetApplicationBusAddress message with an invalid address. Any idea Milan?
Comment 8 Carlos Garcia Campos 2021-08-13 04:03:29 PDT
(In reply to Carlos Garcia Campos from comment #7)
> (In reply to Carlos Garcia Campos from comment #4)
> > (In reply to Michael Catanzaro from comment #3)
> > > Comment on attachment 435414 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=435414&action=review
> > > 
> > > Heh, nice!
> > > 
> > > > Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:41
> > > > +        // We can get warnings from atspi when trying to connect to applications.
> > > > +        Test::removeLogFatalFlag(G_LOG_LEVEL_WARNING);
> > > >          int childCount = atspi_accessible_get_child_count(desktop.get(), nullptr);
> > > > +        Test::addLogFatalFlag(G_LOG_LEVEL_WARNING);
> > > 
> > > What sort of warnings?
> > >
> > 
> > (TestWebKitAccessibility:23612): dbind-WARNING **: 09:35:59.141: AT-SPI:
> > Unable to open bus connection: Failed to connect to socket
> > /run/user/1001/at-spi2-12MT70/socket: No such file or directory
> > 
> > > Certainly not failing the test is good to do, but they probably pollute the
> > > test log, don't they?
> > 
> > It happens once, it seems related to a specific app, it also happens when
> > starting accerciser.
> 
> It turned out to be evolution that is replying to atspi
> GetApplicationBusAddress message with an invalid address. Any idea Milan?

It happens with devhelp too...
Comment 9 Michael Catanzaro 2021-08-13 12:36:32 PDT
(In reply to Carlos Garcia Campos from comment #8)
> It happens with devhelp too...

Sounds like either GTK or WebKit itself is to blame then, right? I doubt devhelp has any a11y-related code at all.
Comment 10 Carlos Garcia Campos 2021-08-20 03:11:16 PDT
(In reply to Michael Catanzaro from comment #9)
> (In reply to Carlos Garcia Campos from comment #8)
> > It happens with devhelp too...
> 
> Sounds like either GTK or WebKit itself is to blame then, right? I doubt
> devhelp has any a11y-related code at all.

I've found the common point, the WebKit bubblewrap sandbox. For some reason atk bridge is creating a dbus server for a socket path that is never created. I don't know what fails exactly, but I would say dbus_server_listen() should fail instead of returning a server for a socket path that doesn't actually exist.
Comment 11 Carlos Garcia Campos 2021-08-20 03:23:54 PDT
(In reply to Carlos Garcia Campos from comment #10)
> (In reply to Michael Catanzaro from comment #9)
> > (In reply to Carlos Garcia Campos from comment #8)
> > > It happens with devhelp too...
> > 
> > Sounds like either GTK or WebKit itself is to blame then, right? I doubt
> > devhelp has any a11y-related code at all.
> 
> I've found the common point, the WebKit bubblewrap sandbox. For some reason
> atk bridge is creating a dbus server for a socket path that is never
> created. I don't know what fails exactly, but I would say
> dbus_server_listen() should fail instead of returning a server for a socket
> path that doesn't actually exist.

It seems the path exists right after the server is created, that's why it doesn't fail, but it's later removed.