desc: Tests timeouts.  Slow, so the file starts with `_`.  Use `make SKIP_SLOW=1` to skip slow tests.
tests:
    # js timeout tests
    # Should timeout after the default of 5 seconds
    - cd: r.js('while(true) {}')
      ot: err("RqlRuntimeError", "JavaScript query `while(true) {}` timed out after 5.000 seconds.", [0])

    - py: r.js('while(true) {}', timeout=1.3)
      js: r.js('while(true) {}', {timeout:1.3})
      rb: r.js('while(true) {}', :timeout => 1.3)
      ot: err("RqlRuntimeError", "JavaScript query `while(true) {}` timed out after 1.300 seconds.", [0])

    - py: r.js('while(true) {}', timeout=8)
      js: r.js('while(true) {}', {timeout:8})
      rb: r.js('while(true) {}', :timeout => 8)
      ot: err("RqlRuntimeError", "JavaScript query `while(true) {}` timed out after 8.000 seconds.", [0])

    - cd: r.expr('foo').do(r.js('(function(x) { while(true) {} })'))
      ot: err("RqlRuntimeError", "JavaScript query `(function(x) { while(true) {} })` timed out after 5.000 seconds.", [0])

    - py: r.expr('foo').do(r.js('(function(x) { while(true) {} })', timeout=1.3))
      js: r.expr('foo').do(r.js('(function(x) { while(true) {} })', {timeout:1.3}))
      rb: r.expr('foo').do(r.js('(function(x) { while(true) {} })', :timeout => 1.3))
      ot: err("RqlRuntimeError", "JavaScript query `(function(x) { while(true) {} })` timed out after 1.300 seconds.", [0])

    - py: r.expr('foo').do(r.js('(function(x) { while(true) {} })', timeout=8))
      js: r.expr('foo').do(r.js('(function(x) { while(true) {} })', {timeout:8}))
      rb: r.expr('foo').do(r.js('(function(x) { while(true) {} })', :timeout => 8))
      ot: err("RqlRuntimeError", "JavaScript query `(function(x) { while(true) {} })` timed out after 8.000 seconds.", [0])
