Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
b279f4c1
Commit
b279f4c1
authored
7 years ago
by
Lars T Hansen
Committed by
Rick Waldron
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make 'wait' tests resilient on slow test systems
parent
7f88a6d7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/built-ins/Atomics/wait/did-timeout.js
+3
-3
3 additions, 3 deletions
test/built-ins/Atomics/wait/did-timeout.js
test/built-ins/Atomics/wait/no-spurious-wakeup.js
+4
-4
4 additions, 4 deletions
test/built-ins/Atomics/wait/no-spurious-wakeup.js
with
7 additions
and
7 deletions
test/built-ins/Atomics/wait/did-timeout.js
+
3
−
3
View file @
b279f4c1
...
...
@@ -15,7 +15,7 @@ $262.agent.receiveBroadcast(function (sab, id) {
var ia = new Int32Array(sab);
var then = Date.now();
$262.agent.report(Atomics.wait(ia, 0, 0, 500)); // Timeout 500ms
$262.agent.report(Date.now() - then);
$262.agent.report(Date.now() - then);
// Actual time can be more than 500ms
$262.agent.leaving();
})
`
);
...
...
@@ -24,11 +24,11 @@ var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
$262
.
agent
.
broadcast
(
ia
.
buffer
);
assert
.
sameValue
(
getReport
(),
"
timed-out
"
);
assert
.
sameValue
(
Math
.
abs
((
getReport
()
|
0
)
-
500
)
<
$ATOMICS_MAX_TIME_EPSILON
,
true
);
assert
.
sameValue
(
Math
.
abs
((
getReport
()
|
0
)
>=
500
-
$ATOMICS_MAX_TIME_EPSILON
,
true
);
function
getReport
()
{
var
r
;
while
((
r
=
$262
.
agent
.
getReport
())
==
null
)
$262
.
agent
.
sleep
(
100
);
$262
.
agent
.
sleep
(
100
);
return
r
;
}
This diff is collapsed.
Click to expand it.
test/built-ins/Atomics/wait/no-spurious-wakeup.js
+
4
−
4
View file @
b279f4c1
...
...
@@ -15,7 +15,7 @@ $262.agent.receiveBroadcast(function (sab, id) {
var ia = new Int32Array(sab);
var then = Date.now();
Atomics.wait(ia, 0, 0);
var diff = Date.now() - then; // Should be about 1000 ms
var diff = Date.now() - then; // Should be about 1000 ms
but can be more
$262.agent.report(diff);
$262.agent.leaving();
})
...
...
@@ -25,10 +25,10 @@ var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
$262
.
agent
.
broadcast
(
ia
.
buffer
);
$262
.
agent
.
sleep
(
500
);
// Give the agent a chance to wait
Atomics
.
store
(
ia
,
0
,
1
);
// Change the value, should not wake the agent
Atomics
.
store
(
ia
,
0
,
1
);
// Change the value, should not wake the agent
$262
.
agent
.
sleep
(
500
);
// Wait some more so that we can tell
Atomics
.
wake
(
ia
,
0
);
// Really wake it up
assert
.
sameValue
(
Math
.
abs
(
(
getReport
()
|
0
)
-
1000
)
<
$ATOMICS_MAX_TIME_EPSILON
,
true
);
Atomics
.
wake
(
ia
,
0
);
// Really wake it up
assert
.
sameValue
((
getReport
()
|
0
)
>=
1000
-
$ATOMICS_MAX_TIME_EPSILON
,
true
);
function
getReport
()
{
var
r
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment