QA/Throttling Tests

From MozillaWiki
< QA
Jump to: navigation, search


Depending on the update strategy, upon release it is reasonable to expect we need to test update throttling:

  • If updates are at 100% you should get a background update
  • 0% you should NOT get a background update
  • Intermediary value should get background updates only for a percentage of cases that's close to the one set (e.g. it's reasonable for a setting of 25%, to get updates in 15-35% of the cases)
  • Throttling testing should be done only on beta and release channels.

Throttling test script


# The following URLS are the 10.0.2 idle-time check urls from
# To test use the following syntax in a terminal prompt, where %URL% is one of the above URLs:
#   ./ URL
# This should be something large if we're testing to see if we're partially throttled.
# It doesn't have to be huge if we're testing fully throttled or not throttled at all.

while [ $attempt -lt $NUM_CHECKS ] ; do
  curl -s $URL | grep -q hashValue
  if [ $? -eq 0 ] ; then
    count=`expr $count + 1`
  percent=`expr $attempt \* 100 / $NUM_CHECKS`
  attempt=`expr $attempt + 1`
  echo "Checking $URL"
  echo "Please wait, this will take several minutes...\n"
  echo "Successful background update pings: $count / $attempt ($percent% complete)"

THROTTLE=`expr $count \* 100 / $attempt`
echo "$URL: $THROTTLE% throttled.\n"

NOTE: The script is meant to run in Linux - for running in Windows, check the instructions below

Running in Linux

The urls to test throttling should look something like this:,MEM:8192/default/default/update.xml Where 55.0.2 is an older version of Firefox than the one you want to update to (in this case, we are testing updates to 55.0.3), and the number after it in the URL is the BuildID of that older version (in this case 55.0.2). The BuildID can be found in the JSON file for the older version, or for 55.0.2, the one specified in: An alternative is to also install the older version, and then get the BuildID from the about:support page.

NOTE: Make sure you get the correct BuildID from the latest released build - a release can have more than one build

To run the script, simply open a Terminal and run: ./,MEM:8192/default/default/update.xml. Make sure is set as an executable file.

Currently the script is run for 5 different Operating Systems. You can run all 5 scripts in parallel, if you execute them in different terminals. See the Current throttling scripts section from below

Running in Windows

To run the throttling script under Windows, you need to do the following:

  1. Install cygwin with curl:
    1. Download the latest cygwin installer
    2. Start the installer
    3. Click/enter preferences until you reach the "Select Packages" window.
    4. Click (+) for Net
    5. Click the entry for curl. (Make sure you select the checkbox for the Binary)
    6. Complete the installation
  2. Verify curl works:
    1. Go to the directory in which you installed Cygwin (default: C:\cygwin64)
    2. Double-click "Cygwin.bat" OR search for "cygwin" in the Windows Start menu and click on "Cygwin64 Terminal"
    3. Run the command "curl" - You should see the following output: curl: try 'curl --help' or 'curl --manual' for more information
  3. Run the script (can run all 5 in separate cygwin terminals -> ALT+F2 to open a new terminal window):
    1. Save locally the following archive, then extract the "" file to your home folder (e.g. C:\cygwin64\home\<username>), or any other destination if desired
    2. Open a Cygwin Terminal window
    3. Run the script:
      1. If the file is saved in C:\cygwin64\home\<username>, then just run: ./
      2. If the file is NOT saved in C:\cygwin64\home\<username>, then cd to the location of the script, and then run: ./

Current throttling scripts

Currently (Firefox 55.0.3) the following 5 scripts are used:

Windows 32bit:
Windows 64bit:
Linux 32bit:
Linux 64bit:

(don't forget the quotation marks " " for Linux command)

To get the most up-to-date scripts, go to the Test Plan wiki page for the most recent version released (e.g. and look on the bottom of the page for "Throttle Testing". You should be able to re-use the same commands, just by modifying the test URLs as specified under the Running in Linux section.

Possible results

  1. 100% Throttling
    1. Running the scripts should always give the result of 100%
  2. 0% Throttling
    1. Running the scripts should always give the result of 0%
  3. 25% Throttling
    1. Running the scripts should ideally be very close to 25% (e.g. within 20-30%)
    2. Running the scripts may yield results varying from 15% to 35% - in this case, can do 2-3 runs to see if results are always somewhere in between these values
    3. When you get any value that's between +/- 5%, you can consider the test as passed