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

tests: update disconnected client scheduler tests to avoid blocking #20615

Merged
merged 1 commit into from
May 16, 2024

Conversation

tgross
Copy link
Member

@tgross tgross commented May 16, 2024

While working on #20462, I discovered that some of the scheduler tests for disconnected clients making long blocking queries. The tests used testutil.WaitForResult to wait for an evaluation to be written to the state store. The evaluation was never written, but the tests were not correctly returning an error for an empty query. This resulted in the tests blocking for 5s and then continuing anyways.

In practice, the evaluation is never written to the state store as part of the test harness Process method, so this test assertion was meaningless. Remove the broken assertion from the two top-level tests that used it, and upgrade these tests to use shoenig/test in the process. This will save us ~50s per test run (for just the test-groups/quick group)

While working on #20462, I discovered that some of the scheduler tests for
disconnected clients making long blocking queries. The tests used
`testutil.WaitForResult` to wait for an evaluation to be written to the state
store. The evaluation was never written, but the tests were not correctly
returning an error for an empty query. This resulted in the tests blocking for
5s and then continuing anyways.

In practice, the evaluation is never written to the state store as part of the
test harness `Process` method, so this test assertion was meaningless. Remove
the broken assertion from the two top-level tests that used it, and upgrade
these tests to use `shoenig/test` in the process. This will save us ~50s per
test run.
@tgross tgross added theme/scheduling theme/testing Test related issues labels May 16, 2024
@tgross tgross added this to the 1.8.0 milestone May 16, 2024
@tgross tgross added backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels May 16, 2024
@tgross tgross marked this pull request as ready for review May 16, 2024 15:53
@@ -3722,18 +3730,18 @@ func TestServiceSched_StopAfterClientDisconnect(t *testing.T) {
}

for i, tc := range cases {
t.Run(fmt.Sprintf(""), func(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃

Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgross tgross merged commit 5666065 into main May 16, 2024
27 checks passed
@tgross tgross deleted the test-updates-scheduler-disconnected-clients branch May 16, 2024 16:16
tgross added a commit that referenced this pull request May 16, 2024
…20615)

While working on #20462, I discovered that some of the scheduler tests for
disconnected clients making long blocking queries. The tests used
`testutil.WaitForResult` to wait for an evaluation to be written to the state
store. The evaluation was never written, but the tests were not correctly
returning an error for an empty query. This resulted in the tests blocking for
5s and then continuing anyways.

In practice, the evaluation is never written to the state store as part of the
test harness `Process` method, so this test assertion was meaningless. Remove
the broken assertion from the two top-level tests that used it, and upgrade
these tests to use `shoenig/test` in the process. This will save us ~50s per
test run.
tgross added a commit that referenced this pull request May 16, 2024
…20615)

While working on #20462, I discovered that some of the scheduler tests for
disconnected clients making long blocking queries. The tests used
`testutil.WaitForResult` to wait for an evaluation to be written to the state
store. The evaluation was never written, but the tests were not correctly
returning an error for an empty query. This resulted in the tests blocking for
5s and then continuing anyways.

In practice, the evaluation is never written to the state store as part of the
test harness `Process` method, so this test assertion was meaningless. Remove
the broken assertion from the two top-level tests that used it, and upgrade
these tests to use `shoenig/test` in the process. This will save us ~50s per
test run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line theme/scheduling theme/testing Test related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants