```ruby
# Common spec-related code goes here

STACK_OVERFLOW_DEPTH = 10000
```

Determine maximum stack depth at runtime.
user
```ruby
# Common spec-related code goes here

STACK_OVERFLOW_DEPTH = begin
  def calculate_stack_overflow_depth(n)
    calculate_stack_overflow_depth(n + 1)
  rescue SystemStackError
    n
  end
  calculate_stack_overflow_depth(2)
end
```
assistant