WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
Bug 47240
new-run-webkit-tests: getting an "error 2" back from ImageDiff
https://bugs.webkit.org/show_bug.cgi?id=47240
Summary
new-run-webkit-tests: getting an "error 2" back from ImageDiff
Dirk Pranke
Reported
2010-10-05 19:18:52 PDT
After tony's change in
r69160
, we're getting an "error 2" back from ImageDiff, and the code is throwing the error away without figuring out whether or not that's a good or bad thing. We should figure out what that error code means and deal with it properly.
Attachments
actual
(48.13 KB, image/png)
2010-10-06 14:52 PDT
,
Tony Chang
no flags
Details
Patch
(3.12 KB, patch)
2011-08-18 11:48 PDT
,
Shawn Singh
no flags
Details
Formatted Diff
Diff
Patch
(3.17 KB, patch)
2011-08-18 11:54 PDT
,
Shawn Singh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tony Chang
Comment 1
2010-10-06 09:44:01 PDT
It's only happening on osx. Here's an example: 2010-10-06 09:23:34,593 executive.py:315 DEBUG "/b/slave/webkit-rel-mac-webkit-org/build/src/xcodebuild/Release/image_diff --diff /tmp/tmparACnM/expected.png /tmp/tmparACnM/actual.png /b/slave/webkit-rel-mac-webkit-org/build/src/webkit/Release/../../../layout-test-results/tables/mozilla_expected_failures/bugs/
bug10140
-diff.png" took 0.06s 2010-10-06 09:23:34,594 chromium.py:160 ERROR image diff returned an exit code of 2 This is the only test that causes the error. Maybe the checked in png is bad?
Tony Chang
Comment 2
2010-10-06 14:52:21 PDT
Created
attachment 69994
[details]
actual Here's the png that image_diff is failing to read. AFAICT, this is a valid png but we never get the end callback when decoding it.
Tony Chang
Comment 3
2010-10-06 15:15:21 PDT
(In reply to
comment #2
)
> Created an attachment (id=69994) [details] > actual > > Here's the png that image_diff is failing to read. AFAICT, this is a valid png but we never get the end callback when decoding it.
But it works fine for me when I copy the image to my Linux machine and feed it to image diff. Maybe there's some OSX specific code causing libpng decode to fail for this file?
Dirk Pranke
Comment 4
2010-10-06 15:29:10 PDT
hm. i thought someone (shans@?) saw this on windows as well ... regardless of whether not there's something wrong with this PNG, it's clear that we hadn't really considered what would happen if image_diff/ImageDiff returns an error. I'm not sure what the right thing to do is, but I would propose that it's something along the lines of (a) log a useful error message at the ERROR level so that it actually shows up all the time, and (b) mark the test as failed, but continue on. By "useful error message", I mean something like we have in the above log, but actually return the full command that failed (like we do in the execute debug statement, but at the ERROR level).
Dirk Pranke
Comment 5
2011-02-18 19:44:37 PST
Taking ownership to see if this is still an issue and if we need to do anything more about it.
Dirk Pranke
Comment 6
2011-04-06 19:44:53 PDT
I don't think it should block
bug 34984
and I plan to clear the blocking flag on Mon 4/11. If you disagree, now would be a good time to speak up :).
Dirk Pranke
Comment 7
2011-04-12 18:03:52 PDT
clearing blocking flag.
Dirk Pranke
Comment 8
2011-05-31 18:51:01 PDT
disclaiming ownership on this as I'm probably not going to be working on it any time soon. Adding Eric and Adam in case they are interested.
Shawn Singh
Comment 9
2011-08-17 17:00:59 PDT
I'm able to reproduce this problem on windows. Furthermore, it seems like I can switch the args of the ImageDiff command, and it always fails on the first png being given to it. So its unlikely to do with the validity of the png itself. I'll keep digging into it, but only for a short while. If I can solve it, I'll take ownership of this bug.
Shawn Singh
Comment 10
2011-08-17 18:13:15 PDT
OK, isolated the problem: the new-run-webkit-tests version of /tmp refers to my cygwin environment temp. the ImageDiff /tmp refers to the windows environment, C:\tmp. So, if people can suggest answers for the following, I can try to resolve it: - is there a way to mark that new-run-webkit-tests failed due to internal error, rather than test failure? That seems like the most ideal choice. the ERROR message is there now, but is easily overlooked when the test passes, and failing the test would be badly misleading. - what is the "right" way to solve it? option 1: if there is a way to detect cygwin environment in python, we can export a CYGWIN_ROOT path, and if that environment exists, ImageDiff can prepend absolute paths option 2: somehow use relative paths to ImageDiff ?
Eric Seidel (no email)
Comment 11
2011-08-17 18:28:09 PDT
ORWT lauches the ImageDiff tool and feeds it Images via stdin/stdout. I think NRWT does that for normal WebKit ports too. TestShell/Chromium has always written the image files out to disk (and I assume it launches a new copy of ImageDiff for each diff it produces.
Dirk Pranke
Comment 12
2011-08-17 18:30:12 PDT
(In reply to
comment #10
)
> OK, isolated the problem: > > the new-run-webkit-tests version of /tmp refers to my cygwin environment temp. the ImageDiff /tmp refers to the windows environment, C:\tmp. >
It sounds like we simply need to wrap the paths we are passing to ImageDiff in calls to cygpath() to get them converted to the native win32 paths. Try changing ChromiumPort.diff_image() in chromium.py to something like the following (trying from memory; don't have a win machine in front of me to test): tempdir = self._filesystem.mkdtemp() expected_filename = self._filesystem.join(str(tempdir), "expected.png") self._filesystem.write_binary_file(expected_filename, expected_contents) actual_filename = self._filesystem.join(str(tempdir), "actual.png") self._filesystem.write_binary_file(actual_filename, actual_contents) if sys.platform == 'cygwin': native_expected_filename = path.cygpath(expected_filename) native_actual_filename = path.cygpath(actual_filename) if diff_filename: native_diff_filename = path.cygpath(diff_filename) else: native_expected_filename = expected_filename native_actual_filename = actual_filename if diff_filename: native_diff_filename = diff_filename executable = self._path_to_image_diff() if diff_filename: cmd = [executable, '--diff', native_expected_filename, native_actual_filename, native_diff_filename] else: cmd = [executable, native_expected_filename, native_actual_filename] If this doesn't work, I can track down the right incantation necessary tomorrow. We shouldn't have to do the more complicated things you're suggesting since cygpath() can handle the conversions for us.
Shawn Singh
Comment 13
2011-08-18 11:48:14 PDT
Created
attachment 104374
[details]
Patch
Dirk Pranke
Comment 14
2011-08-18 11:49:50 PDT
Thanks for hunting this down!
WebKit Review Bot
Comment 15
2011-08-18 11:51:44 PDT
Attachment 104374
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/Scripts/webkitpy..." exit_code: 1 Tools/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Shawn Singh
Comment 16
2011-08-18 11:54:33 PDT
Created
attachment 104375
[details]
Patch
WebKit Review Bot
Comment 17
2011-08-18 13:36:30 PDT
Comment on
attachment 104375
[details]
Patch Clearing flags on attachment: 104375 Committed
r93345
: <
http://trac.webkit.org/changeset/93345
>
WebKit Review Bot
Comment 18
2011-08-18 13:36:35 PDT
All reviewed patches have been landed. Closing bug.
Tony Chang
Comment 19
2011-08-18 13:41:58 PDT
Does this patch fix the original problem mentioned in the bug? Namely that running ImageDiff on mac against the attached png returns an error code of 2.
Shawn Singh
Comment 20
2011-08-18 13:46:40 PDT
For windows/cygwin, it should. There could be several other reasons ImageDiff returns and exit status of 2, so the original problem especially on osx may have had a different cause as well. If you think its best to change the state of this bug, that makes sense to me.
Tony Chang
Comment 21
2011-08-18 13:51:48 PDT
Still likely a problem on OSX.
Dirk Pranke
Comment 22
2011-08-18 13:56:33 PDT
tony, to be clear, are you looking for NRWT to do something different if there is an error returned, or are you looking to see why an error is being returned in this case (or both)?
Tony Chang
Comment 23
2011-08-18 13:59:58 PDT
(In reply to
comment #22
)
> tony, to be clear, are you looking for NRWT to do something different if there is an error returned, or are you looking to see why an error is being returned in this case (or both)?
The latter. Seems like a bug in image_diff.
Ryosuke Niwa
Comment 24
2011-08-19 20:53:44 PDT
This patch appears to have broken a python test on Windows 7 bots:
http://build.webkit.org/builders/Windows%207%20Release%20%28Tests%29/builds/15620
http://build.webkit.org/builders/Windows%207%20Release%20%28Tests%29/builds/15621
Shawn Singh
Comment 25
2011-08-21 23:46:25 PDT
OK, I checked... it seems like test_diff_image in chromium_unittest.py needs updating. I'll submit another patch after I verify the most appropriate way to fix it.
Shawn Singh
Comment 26
2011-08-26 19:18:36 PDT
FYI, I submitted the NRWT windows/cygwin fix in another bug:
https://bugs.webkit.org/show_bug.cgi?id=67078
Eric Seidel (no email)
Comment 27
2011-10-11 13:19:18 PDT
Curious what is the status here? Should this still be open? Should it block
bug 34984
or
bug 64491
?
Shawn Singh
Comment 28
2011-10-11 13:24:07 PDT
I think the status is that its unclear how to reproduce it on osx. Personally I have never encountered the problem on osx. However, its not my place to say that we can close the bug. If it stays open, I think it is worth putting on the blocks list for those issues you mentioned.
Eric Seidel (no email)
Comment 29
2011-10-12 14:46:40 PDT
Dirk? Is there more to do here? Just trying to clean up the list of bugs so I can get a sense for how much NRWT work there is left to do. :)
Dirk Pranke
Comment 30
2011-10-12 14:53:23 PDT
(In reply to
comment #29
)
> Dirk? Is there more to do here? Just trying to clean up the list of bugs so I can get a sense for how much NRWT work there is left to do. :)
Yes, the original issue (also described by tony in
comment #11
) is still unanswered.
Dirk Pranke
Comment 31
2012-08-01 19:28:40 PDT
I've just posted a patch in
bug 92934
that'll actually cause this to be an image diff failure, so if this is still happening we'll likely have to treat it seriously.
Alexey Proskuryakov
Comment 32
2017-02-16 16:20:42 PST
Chromium specific.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug