Isolate Basics

What is the Isolate Project?

Have every test executable list the data files it depends on, which allows the testers bots to only download the files they need instead of the whole Chromium source tree.

What are the Advantages?

By reducing the amount of data that we need to transfer to the tester machines, it becomes much easier to increase the number of tester bots that we have using Swarm (http://www.chromium.org/developers/testing/isolated-testing/swarm), which means that the Try Server and Continuous Integration masters' VMs will have shorter cycle times.

How Can I Run Isolate Locally?

Follow this simple recipe to build browser_tests with ninja in Release:

ninja -C out/Release/browser_tests_run
python tools/swarm_client/isolate.py run -s out/Release/browser_tests.isolated

Replace the keywords accordingly for Debug or another test, e.g. out/Debug/base_unittests_run and out/Debug/base_unittests.isolated.
Known issues:
  • Won't work if you have disable_nacl=1 or component=shared_library in your GYP_DEFINES (for now)
  • Won't work in Debug (for now)

Sections of the Isolate File

Isolate files use a subset of the GYP grammar, so they are valid .gyp files. There are 4 variables that matters:

command

This is the command to execute in order to test this test executable.

isolate_dependency_tracked

Individual files (they can't be directories or symlinks) that must be present (i.e. not an optional dependency)

isolate_dependency_untracked

Directories, symlinks or optional dependencies

isolate_dependency_touched

These are files whose presence is required by the test, but they aren't opened. It happens for example that a file is stat'ed but never opened.

My Test Fails In Isolate Mode! Help!

The only reason that tests should fail in isolate mode but pass when run normally is because they failed to list data files that they access. If you find another reason please contact isolate@chromium.org.

To fix a broken test, the .isolate needs to be updated to include the new data files. The easiest way to determine which files are missing is to run:

python tools/swarm_client/fix_test_cases.py -s out/Release/test_exe.isolated --gtest_filter=MyFailingTests*

This updates the .isolate file to include the missing files. It assumes that the new files are only needed under the current conditions however, i.e. if you're running on Windows it assumes the files are only needed on Windows. If the files are needed on different platforms, you can either run fix_test_cases.py on the various platforms or just manually modify the .isolate.

Simplifying .isolate files

By default a directory is only included if all the files in it are needed. If most of the directory is used and you feel that it makes sense to make the full directory available to simplify the .isolate file,  feel free to replace the individual listings with a single directory listing.

Deployment Timeline

  • April 2 Run base_unittests in isolate mode for the Try Server and the Continuous Integration waterfalls for Release/Linux and Release/Windows.
  • April 8 Commit Queue triggers try jobs that run base_unittests on Swarm instead of running locally.
  • ~2013-05 Run net_unittest, unit_tests and browser_tests in isolate mode for Linux and Windows.
  • ~2013-06 Commit Queue triggers net_unittests, unit_tests and browser_tests on Swarm by default.
Comments