Skip to content

Commit 325cd9e

Browse files
alexmarkovCommit Queue
authored andcommitted
[tests] Attempt to fix flaky standalone/io/named_pipe_type_test
This test has been failing the following error: Unhandled exception: Expect.fail('../itxkmd5wzq/named_pipeTGADTD/typeScript: Error: Error when reading '../itxkmd5wzq/named_pipeTGADTD/typeScript': No such file or directory ') This could happen if the script file has not been written to disk by the time a sub-process is started. In order to fix that, non-awaited File.writeAsString is replaced with File.writeAsStringSync. TEST=standalone/io/named_pipe_type_test Change-Id: Ied68c458a04e7c2a5eb20131bea459cb628e1d97 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417085 Commit-Queue: Alexander Markov <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 4e00733 commit 325cd9e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/standalone/io/named_pipe_type_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ main() async {
2828
print(fileStat.type);
2929
}
3030
''';
31-
File file = new File(join(dir.path, "typeScript"));
32-
file.writeAsString(script);
31+
File file = new File(join(dir.path, "pipe_type.dart"));
32+
file.writeAsStringSync(script);
3333

3434
// If there's no file system access to the pipe, then we can't do a meaningful
3535
// test.
@@ -42,13 +42,13 @@ main() async {
4242

4343
StringBuffer output = new StringBuffer();
4444
Process process = await Process.start(
45-
Platform.executable,
46-
[]
47-
..addAll(Platform.executableArguments)
48-
..add('--sound-null-safety')
49-
..add('--verbosity=warning')
50-
..add('--disable-dart-dev')
51-
..add(file.path));
45+
Platform.executable,
46+
[]
47+
..addAll(Platform.executableArguments)
48+
..add('--verbosity=warning')
49+
..add('--disable-dart-dev')
50+
..add(file.path),
51+
);
5252
bool stdinWriteFailed = false;
5353
process.stdout.transform(utf8.decoder).listen(output.write);
5454
process.stderr.transform(utf8.decoder).listen((data) {

0 commit comments

Comments
 (0)