From e77cf0229db79f3b18e5a0a4934b09360ccc175b Mon Sep 17 00:00:00 2001 From: jmmv Date: Thu, 12 Jul 2018 02:20:04 -0700 Subject: Make spend_cpu_time more reliable by tracking time. First, make the function that wastes user time keep track of how much processor time has been used so far, and make the function that wastes system time track overall wall time. This is to minimize the number of "overhead" system calls, which can tamper with our measurements. Second, make the loop of the function that wastes user time more costly so that modern processors don't run it too fast. Otherwise, the overhead to track used time becomes significant in system time and makes our tests fail. This should fix the flakiness observed in our process-wrapper tests when run on the modern CPUs that the iMac Pros carry. Tested: I haven't been able to reproduce the flakiness. Running the spend_cpu_time binary by hand reports very accurate timings for both system and user time, even when pausing the program while it runs. RELNOTES: None. PiperOrigin-RevId: 204264910 --- .bazelci/presubmit.yml | 3 --- 1 file changed, 3 deletions(-) (limited to '.bazelci') diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 631593930b..52aab52039 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -74,9 +74,6 @@ platforms: - "//tools/android/..." # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663 - "-//src/test/shell/bazel/android:android_ndk_integration_test" - # Re-enable once fixed: b/110456205 - - "-//src/test/java/com/google/devtools/build/lib/shell:ShellTests" - - "-//src/test/shell/integration:process_wrapper_test" # The below tests have been disabled because they are too slow on macOS. # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4684 - "-//src/test/shell/bazel:bazel_determinism_test" -- cgit v1.2.3