Bug 72038 - Lazily start DRT instances in NRWT
Summary: Lazily start DRT instances in NRWT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks: 60605
  Show dependency treegraph
 
Reported: 2011-11-10 11:29 PST by Tony Chang
Modified: 2011-11-11 09:41 PST (History)
6 users (show)

See Also:


Attachments
Patch (5.97 KB, patch)
2011-11-10 11:30 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (9.62 KB, patch)
2011-11-10 12:57 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch for landing (5.97 KB, patch)
2011-11-10 13:10 PST, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2011-11-10 11:29:47 PST
Lazily start DRT instances in NRWT
Comment 1 Tony Chang 2011-11-10 11:30:49 PST
Created attachment 114531 [details]
Patch
Comment 2 Tony Chang 2011-11-10 11:36:03 PST
Comments 24 through 26 on bug 60605 explain why I'm making this change.

https://bugs.webkit.org/show_bug.cgi?id=60605#c24
Comment 3 Eric Seidel (no email) 2011-11-10 12:09:25 PST
Comment on attachment 114531 [details]
Patch

I think we should have a way to test this.  I like the change though.  There is no need for us to have started these eagerly.
Comment 4 Tony Chang 2011-11-10 12:11:32 PST
(In reply to comment #3)
> (From update of attachment 114531 [details])
> I think we should have a way to test this.  I like the change though.  There is no need for us to have started these eagerly.

Ok, I will try to come up with something . . .
Comment 5 Dirk Pranke 2011-11-10 12:25:06 PST
This change seems reasonable to me, but please see comment #27 on bug 60605 for another potential way to solve the problem there.
Comment 6 Tony Chang 2011-11-10 12:57:07 PST
Created attachment 114549 [details]
Patch
Comment 7 Tony Chang 2011-11-10 12:58:21 PST
Here's a unittest, but it's kind of pointless.  Eric, I'm not sure exactly what behavior you want me to be testing.
Comment 8 Eric Seidel (no email) 2011-11-10 13:01:49 PST
Comment on attachment 114549 [details]
Patch

Well, the lazy part is the interesting part, but it looks like that _run_test_in_another_thread is one big function so it looks difficult to test that this is lazy.
Comment 9 Dirk Pranke 2011-11-10 13:04:08 PST
(In reply to comment #7)
> Here's a unittest, but it's kind of pointless. 

I'm not sure what that test is even testing. 

If I was going to write a test for this, I would test that calling create_worker() didn't actually start a DRT instance, and I would put that test in webkitpy/layout_tests/port/port_testcase.py. 

That said, I'm not sure that I think this change needs an additional test, either, since you're simply subtracting a method from the Port API; verifying that the existing tests all still pass seems sufficient to me.
Comment 10 Tony Chang 2011-11-10 13:04:34 PST
(In reply to comment #8)
> (From update of attachment 114549 [details])
> Well, the lazy part is the interesting part, but it looks like that _run_test_in_another_thread is one big function so it looks difficult to test that this is lazy.

I don't think it's important that we lazily start DRT instances.  If some port needed to start it early (say, in the Driver's __init__ method), that seems OK.  That is, nothing really depends on this lazy behavior.
Comment 11 Tony Chang 2011-11-10 13:05:32 PST
(In reply to comment #9)
> (In reply to comment #7)
> > Here's a unittest, but it's kind of pointless. 
> 
> I'm not sure what that test is even testing. 

Yup, I'm not sure what you guys want me to test :)

 
> If I was going to write a test for this, I would test that calling create_worker() didn't actually start a DRT instance, and I would put that test in webkitpy/layout_tests/port/port_testcase.py. 

create_worker() didn't start a DRT instance before this change either.  I'm not sure what that would be testing.
Comment 12 Eric Seidel (no email) 2011-11-10 13:07:37 PST
Comment on attachment 114549 [details]
Patch

LGTM.  I don't think your test adds anythign and should jsut be removed.
Comment 13 Tony Chang 2011-11-10 13:08:24 PST
(In reply to comment #12)
> (From update of attachment 114549 [details])
> LGTM.  I don't think your test adds anythign and should jsut be removed.

Ok, I'll land the first patch without the test.
Comment 14 Tony Chang 2011-11-10 13:10:32 PST
Created attachment 114552 [details]
Patch for landing
Comment 15 Dirk Pranke 2011-11-10 13:13:55 PST
(In reply to comment #11)
> create_worker() didn't start a DRT instance before this change either.  I'm not sure what that would be testing.

Well, given that start() is gone, it would come close to ensuring that the only way a DRT could be started would be by calling run_test. I'm not saying that it would be a great test ;)
Comment 16 Tony Chang 2011-11-10 15:31:54 PST
Committed r99907: <http://trac.webkit.org/changeset/99907>
Comment 17 Philippe Normand 2011-11-11 01:04:46 PST
(In reply to comment #16)
> Committed r99907: <http://trac.webkit.org/changeset/99907>

That one broke GTK...
Landed http://trac.webkit.org/changeset/99935
Comment 18 Eric Seidel (no email) 2011-11-11 09:41:44 PST
(In reply to comment #17)
> (In reply to comment #16)
> > Committed r99907: <http://trac.webkit.org/changeset/99907>
> 
> That one broke GTK...
> Landed http://trac.webkit.org/changeset/99935

We need a unittest for this, or it will break again.