Skip to content

Infinite recursion when KNAPSACK_PRO_LOG_LEVEL is set to debug #269

@dmytro-workday

Description

@dmytro-workday

Hi,

We have set KNAPSACK_PRO_LOG_LEVEL=debug and KNAPSACK_PRO_LOG_DIR=log, which leads to the following backtrace:

[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] SystemStackError: stack level too deep (SystemStackError)
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:240:in `map'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:240:in `detected_ci'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:292:in `ci_env_for'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:282:in `env_for'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:20:in `ci_node_index'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro.rb:99:in `logger'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:285:in `env_for'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:20:in `ci_node_index'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro.rb:99:in `logger'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:285:in `env_for'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro/config/env.rb:20:in `ci_node_index'
[2024-08-15 12:56:16] [2024-08-15 12:56:16] [NODE=4] /builds/app/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-7.8.0/lib/knapsack_pro.rb:99:in `logger'

Seems like the issue is related to the following warnings, throws when the logging directory is not enabled:

You have set the environment variable KNAPSACK_PRO_CI_NODE_TOTAL to 36 which could be automatically determined from the CI environment as 9.
You have set the environment variable KNAPSACK_PRO_CI_NODE_INDEX to 1 which could be automatically determined from the CI environment as 0.

The configuration we used is similar to the FAQ answer here:

https://knapsackpro.com/faq/question/parallel_tests-with-knapsack_pro-on-parallel-ci-nodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions