Fix stack usage benchmark in node (#1734)

This commit is contained in:
Hood Chatham 2021-07-22 05:30:34 +00:00 committed by GitHub
parent 4951de6d4c
commit b2291f8f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -161,7 +161,7 @@ jobs:
- run:
name: stack-size
command: |
pytest -s benchmark/stack_usage.py | sed -n 's/## //pg' || true
pytest -s benchmark/stack_usage.py | sed -n 's/## //pg'
test-emsdk:
<<: *defaults

View File

@ -31,7 +31,7 @@ def print_info():
def test_stack_usage(selenium, print_info):
res = selenium.run_js(
"""
window.measure_available_js_stack_depth = () => {
self.measure_available_js_stack_depth = () => {
let depth = 0;
function recurse() { depth += 1; recurse(); }
try { recurse(); } catch (err) { }
@ -44,7 +44,7 @@ def test_stack_usage(selenium, print_info):
(recurse(0)-recurse(100))/100
`);
let js_depth = measure_available_js_stack_depth();
window.py_depth = [0];
self.py_depth = [0];
try {
pyodide.runPython(`
import sys