Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): fixes testing race when calling Session._action_updated_impl #454

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

ddneilson
Copy link
Contributor

What was the problem/requirement? (What/Why)

Unit tests that call Session._action_updated_impl() were randomly failing
because that function does some work in a Future, and the tests were not waiting for the future to complete before checking results. The future would usually complete quickly, but when it doesn't then the tests would fail.

What was the solution? (How)

Fix the tests by exposing the inner future and waiting on it during the tests.

What is the impact of this change?

Less thrashing trying to get CI tests to pass.

How was this change tested?

Just running the unit tests a bunch of times.

Was this change documented?

N/A

Is this a breaking change?

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ddneilson ddneilson requested a review from a team as a code owner October 29, 2024 14:27
AWS-Samuel
AWS-Samuel previously approved these changes Oct 29, 2024
…impl

Summary:
 Unit tests that call Session._action_updated_impl() were randomly failing
because that function does some work in a Future, and the tests were not waiting
for the future to complete before checking results. The future would usually
complete quickly, but when it doesn't then the tests would fail.

 Fix the tests by exposing the inner future and waiting on it during the tests.

Signed-off-by: Daniel Neilson <[email protected]>
@ddneilson ddneilson force-pushed the fix_racy_session_test branch from 72ce852 to 90b55a6 Compare October 29, 2024 15:23
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
20.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@ddneilson ddneilson enabled auto-merge (squash) October 29, 2024 15:25
@ddneilson ddneilson merged commit 4708e3b into mainline Oct 29, 2024
14 of 15 checks passed
@ddneilson ddneilson deleted the fix_racy_session_test branch October 29, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants