Skip to content

Commit

Permalink
Bug 1865324 [wpt PR 43228] - compute pressure: Try to exit earlier in…
Browse files Browse the repository at this point in the history
… the rate obfuscation web test, a=testonly

Automatic update from web-platform-tests
compute pressure: Try to exit earlier in the rate obfuscation web test

This test is known to be long and apparently times out
on some Mac bots.

This patch is reducing the test execution time by exiting
as soon as the test pass condition is met.

The sampling frequency has been increased to shorten
execution time.

Bug: 1501324
Change-Id: I7f418b5342013b1687099d9a46c7349e67b0decf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5033414
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costaintel.com>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costaintel.com>
Reviewed-by: Fr <beaufort.francoisgmail.com>
Cr-Commit-Position: refs/heads/main{#1231208}

--

wpt-commits: e019315897e3713e2cafb6d462cddf12fcbc67d4
wpt-pr: 43228

UltraBlame original commit: 03fbbf40e90a85a8bcd1a3ce8a9923c6e2fd16ce
  • Loading branch information
marco-c committed Dec 7, 2023
1 parent 09f7267 commit 5f7e2f3
Showing 1 changed file with 97 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mockPressureService
const
sampleRateInHz
=
10
25
;
const
readings
Expand Down Expand Up @@ -47,8 +47,10 @@ maxChangesThreshold
100
;
const
changes
minChangesThreshold
=
50
;
await
new
Promise
Expand All @@ -74,6 +76,98 @@ changes
=
>
{
if
(
observerChanges
.
length
>
=
minChangesThreshold
)
{
t
.
step
(
(
)
=
>
{
assert_less_than_equal
(
observerChanges
.
length
maxChangesThreshold
"
Sample
count
reaching
maxChangesThreshold
.
"
)
;
}
)
;
if
(
observerChanges
.
length
>
0
)
{
const
lastSample
=
observerChanges
.
at
(
-
1
)
;
if
(
(
changes
[
0
]
.
time
-
lastSample
[
0
]
.
time
)
>
=
minPenaltyTimeInMs
)
{
observer
.
disconnect
(
)
;
resolve
(
)
;
}
}
}
observerChanges
.
push
Expand Down Expand Up @@ -112,12 +206,7 @@ i
;
while
(
observerChanges
.
length
<
=
maxChangesThreshold
true
)
{
mockPressureService
Expand Down Expand Up @@ -168,96 +257,7 @@ delivered
)
;
}
observer
.
disconnect
(
)
;
resolve
(
observerChanges
)
;
}
)
;
assert_equals
(
changes
.
length
(
maxChangesThreshold
+
1
)
)
;
let
gotPenalty
=
false
;
for
(
let
i
=
0
;
i
<
changes
.
length
;
i
+
+
)
{
if
(
(
changes
[
i
+
1
]
[
0
]
.
time
-
changes
[
i
]
[
0
]
.
time
)
>
=
minPenaltyTimeInMs
)
{
gotPenalty
=
true
;
break
;
}
}
assert_true
(
gotPenalty
)
;
}
Expand Down

0 comments on commit 5f7e2f3

Please sign in to comment.