From d2c79c81531ff479fbffc94b45e5f1a7aeeb131d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 16 Jan 2025 14:23:45 +0100 Subject: [PATCH] Reduce rounds to 11. Add a comment about timings. On CI timings for complex-cycle are worse than my laptop (for 12 rounds): ubuntu: acceptance.TestAccept/bundle/variables/complex-cycle (2.57s) mac: acceptance.TestAccept/bundle/variables/complex-cycle (1.54s) windows: acceptance.TestAccept/bundle/variables/complex-cycle (2.80s) --- .../mutator/resolve_variable_references.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bundle/config/mutator/resolve_variable_references.go b/bundle/config/mutator/resolve_variable_references.go index 84c5c741c5..9aa93791f8 100644 --- a/bundle/config/mutator/resolve_variable_references.go +++ b/bundle/config/mutator/resolve_variable_references.go @@ -14,7 +14,22 @@ import ( "github.com/databricks/cli/libs/dyn/dynvar" ) -const maxResolutionRounds = 12 +/* +For pathological cases, output and time grow exponentially. + +On my laptop, timings for acceptance/bundle/variables/complex-cycle: +rounds time + + 9 0.10s + 10 0.13s + 11 0.27s + 12 0.68s + 13 1.98s + 14 6.28s + 15 21.70s + 16 78.16s +*/ +const maxResolutionRounds = 11 type resolveVariableReferences struct { prefixes []string