Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
33fd4f15
Unverified
Commit
33fd4f15
authored
Jul 29, 2021
by
Anna Gringauze
Committed by
GitHub
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix race causing null dereference on getStack in web_tool_tests and CI flakes (#87278)
parent
26c30fe2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
test_driver.dart
...ges/flutter_tools/test/integration.shard/test_driver.dart
+13
-9
expression_evaluation_web_test.dart
..._tools/test/web.shard/expression_evaluation_web_test.dart
+1
-1
No files found.
packages/flutter_tools/test/integration.shard/test_driver.dart
View file @
33fd4f15
...
...
@@ -250,17 +250,20 @@ abstract class FlutterTestDriver {
// This method isn't racy. If the isolate is already paused,
// it will immediately return.
Future
<
Isolate
>
waitForPause
()
async
{
Future
<
Isolate
>
waitForPause
()
=>
waitForDebugEvent
(
'Pause'
);
Future
<
Isolate
>
waitForResume
()
=>
waitForDebugEvent
(
'Resume'
);
Future
<
Isolate
>
waitForDebugEvent
(
String
kind
)
async
{
return
_timeoutWithMessages
<
Isolate
>(
()
async
{
final
String
flutterIsolate
=
await
_getFlutterIsolateId
();
final
Completer
<
Event
>
pauseEvent
=
Completer
<
Event
>();
// Start listening for
pause events
.
// Start listening for
events containing 'kind'
.
final
StreamSubscription
<
Event
>
pauseSubscription
=
_vmService
.
onDebugEvent
.
where
((
Event
event
)
{
return
event
.
isolate
.
id
==
flutterIsolate
&&
event
.
kind
.
startsWith
(
'Pause'
);
&&
event
.
kind
.
startsWith
(
kind
);
})
.
listen
((
Event
event
)
{
if
(!
pauseEvent
.
isCompleted
)
{
...
...
@@ -268,14 +271,14 @@ abstract class FlutterTestDriver {
}
});
// But also check if the isolate was already
paused (only after we've set
// up the subscription) to avoid races. If it was paused, we don't need to wait
// But also check if the isolate was already
at the stae we need (only after we've
//
set
up the subscription) to avoid races. If it was paused, we don't need to wait
// for the event.
final
Isolate
isolate
=
await
_vmService
.
getIsolate
(
flutterIsolate
);
if
(
isolate
.
pauseEvent
.
kind
.
startsWith
(
'Pause'
))
{
_debugPrint
(
'Isolate was already
paused
(
${isolate.pauseEvent.kind}
).'
);
if
(
isolate
.
pauseEvent
.
kind
.
startsWith
(
kind
))
{
_debugPrint
(
'Isolate was already
at "
$kind
"
(
${isolate.pauseEvent.kind}
).'
);
}
else
{
_debugPrint
(
'
Isolate is not already paused, waiting for
event to arrive...'
);
_debugPrint
(
'
Waiting for "
$kind
"
event to arrive...'
);
await
pauseEvent
.
future
;
}
...
...
@@ -284,7 +287,7 @@ abstract class FlutterTestDriver {
return
getFlutterIsolate
();
},
task:
'Waiting for isolate to
pause
'
,
task:
'Waiting for isolate to
$kind
'
,
);
}
...
...
@@ -312,6 +315,7 @@ abstract class FlutterTestDriver {
()
async
=>
_vmService
.
resume
(
await
_getFlutterIsolateId
(),
step:
step
),
task:
'Resuming isolate (step=
$step
)'
,
);
await
waitForResume
();
return
waitForNextPause
?
waitForPause
()
:
null
;
}
...
...
packages/flutter_tools/test/web.shard/expression_evaluation_web_test.dart
View file @
33fd4f15
...
...
@@ -174,7 +174,7 @@ void main() {
Future
<
void
>
failToEvaluateExpression
(
FlutterTestDriver
flutter
)
async
{
await
expectLater
(
()
=>
flutter
.
evaluateInFrame
(
'"test"'
),
flutter
.
evaluateInFrame
(
'"test"'
),
throwsA
(
isA
<
RPCError
>().
having
(
(
RPCError
error
)
=>
error
.
message
,
'message'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment