Skip to content

Commit

Permalink
Bug 1937201 [wpt PR 49685] - [wptrunner] Clear screenshot cache betwe…
Browse files Browse the repository at this point in the history
…en retries, a=testonly

Automatic update from web-platform-tests
[wptrunner] Clear screenshot cache between retries (#49685)

Otherwise, the same incorrect result might be retrieved each attempt,
which defeats the retry's purpose.

Workaround for https://crbug.com/383612546
--

wpt-commits: 28cc3c22685edc5ee146f67c8eadc47494a123fe
wpt-pr: 49685

UltraBlame original commit: 1fb818ee8b5cf0624f307bc1b3adb7dccc4e7aa9
  • Loading branch information
marco-c committed Jan 1, 2025
1 parent 67295b7 commit 7635950
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import
collections
import
contextlib
import
errno
Expand Down Expand Up @@ -613,6 +615,21 @@
(
)

self
.
screenshot_caches
=
collections
.
defaultdict
(
self
.
cache_manager
.
dict
)

self
.
stash
Expand Down Expand Up @@ -965,6 +982,47 @@
=
None

def
reset
(
self
)
:

"
"
"
Reset
state
between
retry
attempts
to
isolate
failures
.
"
"
"

for
cache
in
self
.
screenshot_caches
.
values
(
)
:

cache
.
clear
(
)

contextlib
.
contextmanager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,26 @@
)
:

screenshot_cache
=
test_environment
.
screenshot_caches
[
test_type
subsuite
.
name
]

executor_kwargs
[
"
screenshot_cache
"
]
=
test_environment
.
cache_manager
.
dict
(
)
screenshot_cache

executor_kwargs
[
Expand Down Expand Up @@ -2664,9 +2670,6 @@
key
=
(
self
.
subsuite
test
.
url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,12 @@
]
)

test_environment
.
reset
(
)

with
ManagerGroup
(
Expand Down

0 comments on commit 7635950

Please sign in to comment.