Skip to content

Address flakes from using temp directory to run tests #2649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dwds/test/fixtures/project.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,10 @@ class TestProject {
try {
_fixturesCopy.deleteSync(recursive: true);
} on FileSystemException catch (_) {
assert(Platform.isWindows);
// On Windows, the build daemon process might still be accessing the
// working directory, so wait a second and then try again.
await Future.delayed(const Duration(seconds: 1));
// working directory, so wait a few seconds and then try again.
await Future.delayed(const Duration(seconds: 5));
_fixturesCopy.deleteSync(recursive: true);
}
}
Expand Down
4 changes: 3 additions & 1 deletion test_common/lib/utilities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ const fixturesDirName = 'fixtures';

const newDdcTypeSystemVersion = '3.3.0-242.0.dev';

final _currentDirectory = p.current;

/// The path to the webdev directory in the local machine, e.g.
/// '/workstation/webdev'.
String get webdevPath {
final pathParts = p.split(p.current);
final pathParts = p.split(_currentDirectory);
assert(pathParts.contains(webdevDirName));
return p.joinAll(
pathParts.sublist(0, pathParts.lastIndexOf(webdevDirName) + 1),
Expand Down
Loading