Skip to content

Commit f8a3381

Browse files
fix: resolve flaky test due to non-deterministic variation ordering (#6269)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: gagantrivedi <[email protected]>
1 parent 64aa842 commit f8a3381

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/tests/unit/integrations/launch_darkly/test_services.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ def test_process_import_request__success__expected_status( # type: ignore[no-un
223223
percentage_mv_feature_states_by_env_name["Test"].get_feature_state_value()
224224
== "variation2"
225225
)
226-
assert list(
226+
assert set(
227227
percentage_mv_feature_states_by_env_name[
228228
"Test"
229229
].multivariate_feature_state_values.values_list(
230230
"multivariate_feature_option__string_value",
231231
"percentage_allocation",
232232
)
233-
) == [("variation1", 100), ("variation2", 0), ("variation3", 0)]
233+
) == {("variation1", 100), ("variation2", 0), ("variation3", 0)}
234234

235235
assert percentage_mv_feature_states_by_env_name["Production"].enabled is True
236236

@@ -239,14 +239,14 @@ def test_process_import_request__success__expected_status( # type: ignore[no-un
239239
percentage_mv_feature_states_by_env_name["Production"].get_feature_state_value()
240240
== "variation3"
241241
)
242-
assert list(
242+
assert set(
243243
percentage_mv_feature_states_by_env_name[
244244
"Production"
245245
].multivariate_feature_state_values.values_list(
246246
"multivariate_feature_option__string_value",
247247
"percentage_allocation",
248248
)
249-
) == [("variation1", 24), ("variation2", 25), ("variation3", 51)]
249+
) == {("variation1", 24), ("variation2", 25), ("variation3", 51)}
250250

251251
# Tags are imported correctly.
252252
tagged_feature = Feature.objects.get(project=project, name="flag5")

0 commit comments

Comments
 (0)