Bug 138831

Summary: [GTK] Use GMainLoopSource in WebKitTestRunner
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, clopez, commit-queue, gustavo, pnormand, svillar
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 139124    
Bug Blocks:    
Attachments:
Description Flags
Patch svillar: review+, svillar: commit-queue-

Description Carlos Garcia Campos 2014-11-18 04:19:48 PST
Instead of g_timeout_add().
Comment 1 Carlos Garcia Campos 2014-11-18 04:21:54 PST
Created attachment 241782 [details]
Patch
Comment 2 Sergio Villar Senin 2014-11-28 00:38:54 PST
Comment on attachment 241782 [details]
Patch

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

> Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:70
> +    }, std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(timeout)));

I think you forgot to remove the timeoutCallback static function now that you have the lambda.
Comment 3 Carlos Garcia Campos 2014-11-28 08:37:56 PST
(In reply to comment #2)
> Comment on attachment 241782 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241782&action=review
> 
> > Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:70
> > +    }, std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(timeout)));
> 
> I think you forgot to remove the timeoutCallback static function now that
> you have the lambda.

Right!
Comment 4 Carlos Garcia Campos 2014-11-28 08:39:28 PST
Committed r176566: <http://trac.webkit.org/changeset/176566>
Comment 5 Carlos Alberto Lopez Perez 2014-12-01 05:33:19 PST
(In reply to comment #4)
> Committed r176566: <http://trac.webkit.org/changeset/176566>

This broke the performance bot.
Reported here: https://bugs.webkit.org/show_bug.cgi?id=139122
Comment 6 WebKit Commit Bot 2014-12-01 06:33:40 PST
Re-opened since this is blocked by bug 139124
Comment 7 Carlos Alberto Lopez Perez 2014-12-01 06:51:37 PST
I reverted r176566 on r176591 <https://trac.webkit.org/r176591> after talking with Carlos Garcia.
Comment 8 Carlos Garcia Campos 2014-12-07 06:06:19 PST
(In reply to comment #7)
> I reverted r176566 on r176591 <https://trac.webkit.org/r176591> after
> talking with Carlos Garcia.

Ok, I forgot to handle the case of no-timeout :-P. I'll land a right version.
Comment 9 Carlos Garcia Campos 2014-12-07 06:07:43 PST
Committed r176921: <http://trac.webkit.org/changeset/176921>
Comment 10 Alexey Proskuryakov 2014-12-15 12:55:10 PST
Comment on attachment 241782 [details]
Patch

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

> Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:52
> +    m_waitToDumpWatchdogTimer.scheduleAfterDelay("[WTR] waitToDumpWatchdogTimerCallback", [this] { waitToDumpWatchdogTimerFired(); },
> +        std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(waitToDumpWatchdogTimerInterval)));

waitToDumpWatchdogTimerInterval is 30, for 30 seconds. Is the cast to microseconds the right one here?

> Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:71
>      gtk_main();

Ditto, why microseconds?
Comment 11 Carlos Garcia Campos 2014-12-16 01:48:21 PST
(In reply to comment #10)
> Comment on attachment 241782 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241782&action=review
> 
> > Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:52
> > +    m_waitToDumpWatchdogTimer.scheduleAfterDelay("[WTR] waitToDumpWatchdogTimerCallback", [this] { waitToDumpWatchdogTimerFired(); },
> > +        std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(waitToDumpWatchdogTimerInterval)));
> 
> waitToDumpWatchdogTimerInterval is 30, for 30 seconds. Is the cast to
> microseconds the right one here?

Yes, the scheduleAfterDelay() version that receives the delay in microseconds creates a glib source using microseconds. For this particular case we could use milliseconds, but we moved all sources using a double value to microseconds to avoid truncations (we had cases in which timers were scheduled immediately because the conversion to milliseconds was 0, see bug #137782).

> > Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:71
> >      gtk_main();
> 
> Ditto, why microseconds?