Summary: | Add some WorkQueue tests to TestWebKitAPI | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||||
Component: | Tools / Tests | Assignee: | Brent Fulgham <bfulgham> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | andersca, bfulgham, ddkilzer, gyuyoung.kim, koivisto, mrobinson, sam | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | 142432 | ||||||||||
Bug Blocks: | 142471, 142473 | ||||||||||
Attachments: |
|
Description
Brent Fulgham
2015-03-07 20:21:43 PST
Created attachment 248181 [details]
Patch
Comment on attachment 248181 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=248181&action=review > Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp:110 > + std::this_thread::sleep_for(std::chrono::nanoseconds(1000)); I'm just trying to simulate some lengthy bit of work here. Maybe there's a better way? > Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp:132 > + queue1->dispatchAfter(std::chrono::milliseconds(100), finishedTests); I want to verify that the two queues work independently. Not sure if there is a better way to do this? Maybe more condition variables to coordinate the order of things? Created attachment 248182 [details]
Patch v2 (Activate on Windows)
Comment on attachment 248182 [details] Patch v2 (Activate on Windows) View in context: https://bugs.webkit.org/attachment.cgi?id=248182&action=review > Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp:124 > + queue1->dispatchAfter(std::chrono::milliseconds(100), finishedTests); I'm trying to simulate two queues performing different amounts of work. Maybe there's a better way than these delays... Created attachment 248203 [details]
Patch v3 (Update per weinig comments)
Comment on attachment 248203 [details] Patch v3 (Update per weinig comments) View in context: https://bugs.webkit.org/attachment.cgi?id=248203&action=review > Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp:191 > + EXPECT_TRUE(done >= start + std::chrono::milliseconds(500)); I am not sure how guaranteed accurate dispatchAfter is. Comment on attachment 248203 [details]
Patch v3 (Update per weinig comments)
The tests look good, though the DispatchAfter worries me that it could be flakey (as all timing depended tests are). I would land it without testing that the actual timing matches up.
Committed r181249: <http://trac.webkit.org/changeset/181249> EFL and GTK ports should probably add this test as well. The corresponding change for CMake is here: https://bugs.webkit.org/show_bug.cgi?id=142473 Attempt to fix WTF_WorkQueue.TwoQueues timeout test failure <http://trac.webkit.org/changeset/181265> Easiest to see where it started failing here: <https://build.webkit.org/builders/Apple%20Mavericks%20Debug%20WK2%20(Tests)?numbuilds=50> (In reply to comment #11) > Attempt to fix WTF_WorkQueue.TwoQueues timeout test failure > <http://trac.webkit.org/changeset/181265> > > Easiest to see where it started failing here: > <https://build.webkit.org/builders/ > Apple%20Mavericks%20Debug%20WK2%20(Tests)?numbuilds=50> Looks like that worked. Thank you for fixing that! |