dart-sdk/tools
Jens Johansen 501cca4741 [test.py] Fix race condition when copying files
When testing multitests needed files are copied, but some files are
copied multiple times, creating race conditions that might cause tests
to fail because incomplete files are read.

For instance running
"python tools/test.py -m release -c dartk --strong language_2"
is fine (i.e. everything passes), but running
"python tools/test.py -m release -c dartk --strong language_2/generic_constructor_mixin3_test"
can get 0, 1 or 2 errors depending on the computers mood...

This fixes the problem by introducing a map from copied-to-path to Future,
so the same Future is returned when asked to copy a file subsequent times,
thus avoiding the race condition.

Fixes #31368.

Bug:
Change-Id: Id7d4a12424085c75f3543bd06a617121ad5eff35
Reviewed-on: https://dart-review.googlesource.com/32282
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-01-05 07:50:54 +00:00
..
android
apps/update_homebrew
bots [Infra] Correct step name in test matrix 2018-01-03 13:52:24 +00:00
buildtools [infra] Roll clang toolchain forward 2018-01-03 23:37:15 +00:00
dart2js
dartk_wrappers
dom
gardening
infra/config
linux_dist_support/debian
migration
sdks
spec_parser
testing [test.py] Fix race condition when copying files 2018-01-05 07:50:54 +00:00
.gitignore
addlatexhash.dart
archive_crash.py
build.py
canary.dart
capture_screenshot.ps1
clean_output_directory.py
compile_platform.py
copy_dart.py
copy_tree.py
create_debian_chroot.sh
create_debian_packages.py
create_pkg_manifest.py
create_tarball.py
create_timestamp_file.py
download_chromium_sysroot.sh
download_latest_dev_sdk.py
execute_recorded_testcases.py
FAKE_COMMITS
find_depot_tools.py
gen_fuchsia_test_manifest.py
generate_buildfiles.py
get_archive.py
gn.py
gn_helpers.py
line_doc_comments.dart
list_dart_files.py
list_files.py
make_bundle_unittest.py
make_version.py
ninja.py
observatory_tool.py
only_in_release_mode.py
patch_sdk.dart
patch_sdk.py
presubmit.sh
print_version.py
promote.py
publish_pkg.py
revert.py
run_dart.py
safari_factory_reset.py
set_ia32_sysroot.sh
set_x64_sysroot.sh
spec_parse.py
status_clean.dart
task_kill.py
test.py
utils.py
VERSION
write_revision_file.py
write_version_file.py
yaml2json.dart
yaml2json.py