Bug 103744 - Make svg/dom/viewspec-parser-*.html non-flaky
Summary: Make svg/dom/viewspec-parser-*.html non-flaky
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jussi Kukkonen (jku)
URL:
Keywords:
: 87772 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-30 07:12 PST by Jussi Kukkonen (jku)
Modified: 2012-12-04 00:53 PST (History)
5 users (show)

See Also:


Attachments
Patch (203.51 KB, patch)
2012-12-03 01:02 PST, Jussi Kukkonen (jku)
no flags Details | Formatted Diff | Diff
patch with every test preserved (215.89 KB, patch)
2012-12-03 12:10 PST, Jussi Kukkonen (jku)
no flags Details | Formatted Diff | Diff
patch with every test preserved + changelog typo fixed (215.89 KB, patch)
2012-12-03 12:46 PST, Jussi Kukkonen (jku)
no flags Details | Formatted Diff | Diff
Reupload. Please behave, commit-queue (215.92 KB, patch)
2012-12-04 00:22 PST, Jussi Kukkonen (jku)
no flags Details | Formatted Diff | Diff
Reupload. Please behave, commit-queue (215.91 KB, patch)
2012-12-04 00:29 PST, Jussi Kukkonen (jku)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jussi Kukkonen (jku) 2012-11-30 07:12:52 PST
Filing this so I don't forget: svg/dom/viewspec-parser-*.html are flaky.

Bug 87726 tried to fix the situation but AFAICT based on the results.txt it only created 5 tests that all individually take as long as the original one test did...

Should either figure out how to test this area without this semi-random fuzzing or implement what bug 87726 tried to implement (divide the tests into smaller sets).
Comment 1 Jussi Kukkonen (jku) 2012-12-03 01:02:46 PST
Created attachment 177203 [details]
Patch
Comment 2 Jussi Kukkonen (jku) 2012-12-03 01:04:28 PST
Comment on attachment 177203 [details]
Patch

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

> LayoutTests/ChangeLog:14
> +        Modified viewspec-parser-*.html in three ways:
> +        - remove duplicate testing: the five files were all running
> +          the exact same tests (only a few percent were unique).
> +        - move the test division out of viewspec-parser.js to make it more
> +          visible, divide the tests into logical sets.
> +        - cut down on the number of 'random valid values' tests: Instead of
> +          300 tests, run 72.

The first two points should be no-brainers and I've compared the output
to the current output: all the tests are included and the results are same, just faster.

The last item is just my suggestion: I can add a couple more test files to run the rest
of the 'random valid values' tests if that's wanted. I'm not sure that adds much real
coverage though, adding some intelligence to the fuzzer might be a better option. E.g.
using the known argument numbers/types for the attributes to produce more interesting
test material.
Comment 3 Jussi Kukkonen (jku) 2012-12-03 01:15:09 PST
Adding some earlier authors/reviewers in CC in hope of a review (or just opinion on the  number of "random valid values" tests).
Comment 4 Dirk Schulze 2012-12-03 04:17:33 PST
*** Bug 87772 has been marked as a duplicate of this bug. ***
Comment 5 Dirk Schulze 2012-12-03 04:23:42 PST
Comment on attachment 177203 [details]
Patch

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

You removed by far to  many test scenarios. Something that might work for me is splitting the test into multiple files and keep the flacky parts in the original parser files. Exponent parsing and correct comma parsing is very necessary.

> LayoutTests/svg/dom/viewspec-parser-1-expected.txt:-73
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(74- 9.(+ e.0e635
> -Parsed: [initial view] from: svgView(viewBox(74- 9.(+ e.0e635
> -
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(-9,).8e7e4e9ee
> -Parsed: [initial view] from: svgView(viewBox(-9,).8e7e4e9ee 
> -
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(49-,,4)30378.052
> -Parsed: [initial view] from: svgView(viewBox(49-,,4)30378.052
> -
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(e7863e
> -Parsed: [initial view] from: svgView(viewBox(e7863e
> -
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(0
> -Parsed: [initial view] from: svgView(viewBox(	0
> -
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(e72(e,49.7.
> -Parsed: [initial view] from: svgView(viewBox(e72(	e	,49.7.
> -
> -Loaded: resources/viewspec-target.svg#svgView(viewBox(e55,
> -Parsed: [initial view] from: svgView(viewBox(e55, 

All this seems not to be covered by the test anymore.
Comment 6 Jussi Kukkonen (jku) 2012-12-03 11:14:40 PST
(In reply to comment #5)
> (From update of attachment 177203 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177203&action=review
> 
> You removed by far to  many test scenarios. Something that might work for me is splitting the test into multiple files and keep the flacky parts in the original parser files. Exponent parsing and correct comma parsing is very necessary.

There's no flaky parts as such as far as I can tell -- the tests would just timeout  because they contained hundreds of parsing tests and every test modifies the dom a couple of times (including adding an iframe)...

> > LayoutTests/svg/dom/viewspec-parser-1-expected.txt:-73
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(74- 9.(+ e.0e635
> > -Parsed: [initial view] from: svgView(viewBox(74- 9.(+ e.0e635
> > -
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(-9,).8e7e4e9ee
> > -Parsed: [initial view] from: svgView(viewBox(-9,).8e7e4e9ee 
> > -
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(49-,,4)30378.052
> > -Parsed: [initial view] from: svgView(viewBox(49-,,4)30378.052
> > -
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(e7863e
> > -Parsed: [initial view] from: svgView(viewBox(e7863e
> > -
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(0
> > -Parsed: [initial view] from: svgView(viewBox(	0
> > -
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(e72(e,49.7.
> > -Parsed: [initial view] from: svgView(viewBox(e72(	e	,49.7.
> > -
> > -Loaded: resources/viewspec-target.svg#svgView(viewBox(e55,
> > -Parsed: [initial view] from: svgView(viewBox(e55, 
> 
> All this seems not to be covered by the test anymore.

I've checked these, and every example listed here is actually tested by viewspec-parser-3.html in my patch. Anyway, as I said, I'll be happy to include all the old tests if that seems safer.

I don't know how the parser actually works but looking at the tests I'm guessing the "Random assortments of valid characters" tests (viewspec-parser-3.html in my patch) only test the part of the parser where it decides if the attribute signature is valid or not... and almost none of them are actually valid. My guess is the arguments are never parsed or at least the tester can't tell if they are (as we only get "[initial view]" as the parsed value).
Comment 7 Jussi Kukkonen (jku) 2012-12-03 12:10:56 PST
Created attachment 177304 [details]
patch with every test preserved
Comment 8 Jussi Kukkonen (jku) 2012-12-03 12:46:43 PST
Created attachment 177312 [details]
patch with every test preserved + changelog typo fixed
Comment 9 Dirk Schulze 2012-12-03 13:13:46 PST
Comment on attachment 177312 [details]
patch with every test preserved + changelog typo fixed

I think this looks reasonable. r=me.
Comment 10 WebKit Review Bot 2012-12-04 00:11:56 PST
Comment on attachment 177312 [details]
patch with every test preserved + changelog typo fixed

Rejecting attachment 177312 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
it line 152.

Failed to run "['Tools/Scripts/update-webkit', '--chromium', '--force-update']" exit_code: 2
Updating OpenSource
From http://git.chromium.org/external/Webkit
 + 54297d7...12af24d HEAD       -> origin/HEAD  (forced update)
error: Ref refs/remotes/origin/master is at 12af24d2f26725d342ea591d58b957f0268c6ca8 but expected 54297d74214132a39292f05bb9466fdab588b0aa
 ! 54297d7...12af24d master     -> origin/master  (unable to update local ref)
Died at Tools/Scripts/update-webkit line 152.

Full output: http://queues.webkit.org/results/15121639
Comment 11 Jussi Kukkonen (jku) 2012-12-04 00:22:09 PST
Created attachment 177433 [details]
Reupload. Please behave, commit-queue
Comment 12 Jussi Kukkonen (jku) 2012-12-04 00:29:32 PST
Created attachment 177435 [details]
Reupload. Please behave, commit-queue
Comment 13 WebKit Review Bot 2012-12-04 00:53:32 PST
Comment on attachment 177435 [details]
Reupload. Please behave, commit-queue

Clearing flags on attachment: 177435

Committed r136486: <http://trac.webkit.org/changeset/136486>
Comment 14 WebKit Review Bot 2012-12-04 00:53:36 PST
All reviewed patches have been landed.  Closing bug.