[webkit-changes] [WebKit/WebKit] c2f8b4: Workaround occasional black snapshots on macOS

Simon Fraser noreply at github.com
Tue Dec 6 11:56:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c2f8b499772412dbf100797162778234cd634a67
      https://github.com/WebKit/WebKit/commit/c2f8b499772412dbf100797162778234cd634a67
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    A LayoutTests/fast/harness/all-black-expected.html
    A LayoutTests/fast/harness/all-black.html
    M Tools/WebKitTestRunner/TestInvocation.cpp
    M Tools/WebKitTestRunner/TestInvocation.h
    M Tools/WebKitTestRunner/cg/TestInvocationCG.cpp

  Log Message:
  -----------
  Workaround occasional black snapshots on macOS
https://bugs.webkit.org/show_bug.cgi?id=248718
rdar://89840327

Reviewed by Jonathan Bedard.

An OS issue (rdar://89840327) causes test snapshots to be black sometimes,
on Intel machines.

Try to work around this by detecting black snapshots, and re-taking the snapshot
up to three times. We detect black snapshots via their hash, hardcoding
the hashes of some commonly sized black snapshots for performance. The code
logs when black snapshots are detected, but this does not trigger test failure.

Add an all-black ref test in fast/harness to test that all black ref tests
still succeed.

* LayoutTests/fast/harness/all-black-expected.html: Added.
* LayoutTests/fast/harness/all-black.html: Added.
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::compareActualHashToExpectedAndDumpResults):
* Tools/WebKitTestRunner/TestInvocation.h:
* Tools/WebKitTestRunner/cg/TestInvocationCG.cpp:
(WTR::computeSHA1HashStringForContext):
(WTR::operator==):
(WTR::hashForBlackImageOfSize):
(WTR::dumpBitmap):
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected):

Canonical link: https://commits.webkit.org/257420@main




More information about the webkit-changes mailing list