Fix for flaky hanging unit test

Rarely, the raceConditionWithNoKeepGoingErrors_InflightError unit test
would timeout because the "errorKey" node's error caused
preventNewEvaluations to be called before the otherKey node started
evaluation. The "otherKey" node's function decrements a CountdownLatch
that the test waits on.

Usually both nodes' functions would start evaluating before
preventNewEvaluations was called, but this wasn't guaranteed.

This change makes the execution of the unit test deterministic. Both
nodes will begin evaluation before either finishes. The "otherErrorKey"
node will wait for "errorKey" to commit before trying to get its value.
The "otherErrorKey" compute function will get called exactly once
because its dependency on "errorKey" will not be registered because
"errorKey" errored first and in nokeep_going mode only the first
erroring node's dependencies are registered.

--
MOS_MIGRATED_REVID=87657504
1 file changed
tree: f86dcc7b599a1172c6267d3f64cc3000b01ac5ec
  1. base_workspace/
  2. docs/
  3. src/
  4. third_party/
  5. tools/
  6. .gitignore
  7. .travis.yml
  8. base_workspace_test.sh
  9. bootstrap_test.sh
  10. compile.sh
  11. FAQ.md
  12. LICENSE.txt
  13. README.md
  14. README.windows
  15. WORKSPACE
README.md

Bazel is very much a work in progress. We'd love if you tried it out, but there are many rough edges. Please feel free to give us feedback!

Bazel

{Fast, Correct} - Choose two

Bazel is an build tool that builds code quickly and reliably. It executes as few build steps as possible by tracking dependencies and outputs, controls the build environment to keep builds hermetic, and uses its knowledge of dependencies to parallelize builds.

This README file contains instructions for building and running Bazel.

System Requirements

Supported platforms:

  • Ubuntu Linux
  • Mac OS X (experimental only)

Java:

  • Java JDK 8 or later

Getting Bazel

  1. Clone the Bazel repo from GitHub:

     $ cd $HOME
     $ git clone https://github.com/google/bazel/
    

Building Bazel

Building Bazel on Ubuntu

To build Bazel on Ubuntu:

  1. Install required package:

     $ sudo apt-get install libarchive-dev
    
  2. Build Bazel:

     $ cd bazel
     $ ./compile.sh
    

Building Bazel on OS X (experimental)

Using Bazel on Mac OS X requires:

  • Xcode and Xcode command line tools
  • MacPorts or Homebrew for installing required packages

To build Bazel on Mac OS X:

  1. Install required packages:

     $ port install protobuf-cpp libarchive
    

    or

     $ brew install protobuf libarchive
    
  2. Build Bazel:

     $ cd bazel
     $ ./compile.sh
    

Running Bazel

The Bazel executable is located at <bazel_home>/output/bazel.

You must run Bazel from within a workspace directory. Bazel provides a default workspace directory with sample BUILD files and source code in <bazel_home>/base_workspace. The default workspace contains files and directories that must be present in order for Bazel to work. If you want to build from source outside the default workspace directory, copy the entire base_workspace directory to the new location before adding your BUILD and source files.

Build a sample Java application:

    $ cp -R $HOME/bazel/base_workspace $HOME/my_workspace
    $ cd $HOME/my_workspace
    $ $HOME/bazel/output/bazel build //examples/java:hello-world

Note: on OS X, you must specify --cpu=darwin to build Java programs (e.g., bazel build --cpu=darwin //examples/java:hello-world).

The build output is located in $HOME/my_workspace/bazel-bin/examples/java/.

Run the sample application:

$ $HOME/my_workspace/bazel-bin/examples/java/hello-world