Skip to content

Commit 46bbee5

Browse files
fix: Make printWarningIfArgumentIsDeprecated unit test deterministic (#633)
## Description: <!-- Describe this change, how it works, and the motivation behind it. --> `printWarningIfArgumentIsDeprecated` is flaky: https://app.circleci.com/pipelines/github/kurtosis-tech/kurtosis/3488/workflows/72a67e18-3fae-4734-b97b-47f278c39b3a/jobs/42730 This is because the test relies on a given order of iteration of `sync.Map`, that is not deterministic and will yield different order from time to time. ## Is this change user facing? NO <!-- If yes, please add the "user facing" label to the PR --> <!-- If yes, don't forget to include docs changes where relevant --> ## References (if applicable): <!-- Add relevant Github Issues, Discord threads, or other helpful information. -->
1 parent 0e212c9 commit 46bbee5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

core/server/api_container/server/startosis_engine/kurtosis_starlark_framework/kurtosis_base_builtin_internal_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@ func Test_printWarningIfArgumentIsDeprecated(t *testing.T) {
9595
require.Len(t, warnings, 2)
9696

9797
// just checking only one warning to make sure that the string formatting works
98-
require.Contains(t, warnings[0],
99-
fmt.Sprintf("%q field for %q will be deprecated by %v. %v",
100-
"config",
101-
"kurtosis_builtin",
102-
deprecatedDate.GetFormattedDate(),
103-
deprecatedMitigation,
104-
))
98+
expectedWarning := fmt.Sprintf("[WARN]: %q field for %q will be deprecated by %v. %v",
99+
"config",
100+
"kurtosis_builtin",
101+
deprecatedDate.GetFormattedDate(),
102+
deprecatedMitigation,
103+
)
104+
require.Contains(t, warnings, expectedWarning)
105+
105106
}
106107

107108
func Test_printWarningForBuiltinIsDeprecated(t *testing.T) {

0 commit comments

Comments
 (0)