Skip to content

Use EventuallyWithT in versioning tests#10160

Open
stephanos wants to merge 3 commits intomainfrom
stephanos/versioning-eventuallywitht
Open

Use EventuallyWithT in versioning tests#10160
stephanos wants to merge 3 commits intomainfrom
stephanos/versioning-eventuallywitht

Conversation

@stephanos
Copy link
Copy Markdown
Contributor

@stephanos stephanos commented May 1, 2026

What changed?

Replaces (almost) all use of s.Eventually with s.EventuallyWithT.

Why?

Assertions are often used inside s.Eventually here and that's not safe as it aborts the test immediately.

@stephanos stephanos closed this May 1, 2026
@stephanos stephanos force-pushed the stephanos/versioning-eventuallywitht branch from 327c95b to 76d568a Compare May 1, 2026 22:39
@stephanos stephanos reopened this May 1, 2026
@stephanos stephanos changed the title Stephanos/versioning eventuallywitht Use EventuallyWithT in versioning tests May 1, 2026
@stephanos stephanos force-pushed the stephanos/versioning-eventuallywitht branch from 327c95b to 9834f54 Compare May 1, 2026 22:41
}
return true
}, 10*time.Second, 100*time.Millisecond)
return true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm, why was this nested?

@stephanos stephanos force-pushed the stephanos/versioning-eventuallywitht branch 4 times, most recently from 8ef7b41 to 2a6fece Compare May 1, 2026 23:05
).Error())
}
s.NoError(err)
return err == nil
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't understand why this was so complicated when in the end it really retries until there are no errors anymore?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the point here is to retry only if you do get an error that is one of notFound or ErrCurrentVersionDoesNotHaveAllTaskQueues

If this API were to return something else, then the s.NoError(err) would fail and the test would fail imo

Copy link
Copy Markdown
Contributor Author

@stephanos stephanos May 5, 2026

Choose a reason for hiding this comment

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

Ohh, I see. Alright, the s.NoError did fail the test before my change, but only after the entire Eventually timeout elapsed. I've restored the original intent in 381d35d while not waiting for the entire timeout anymore.

@stephanos stephanos force-pushed the stephanos/versioning-eventuallywitht branch from 2a6fece to d2ccd90 Compare May 1, 2026 23:15
@stephanos stephanos force-pushed the stephanos/versioning-eventuallywitht branch from d2ccd90 to df03fed Compare May 1, 2026 23:24
@stephanos stephanos marked this pull request as ready for review May 1, 2026 23:24
@stephanos stephanos requested review from a team as code owners May 1, 2026 23:24
@stephanos stephanos requested a review from Shivs11 May 1, 2026 23:24
Copy link
Copy Markdown
Member

@Shivs11 Shivs11 left a comment

Choose a reason for hiding this comment

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

just left that one comment since i think your change changes the behaviour here

Comment thread tests/versioning_test.go
TaskQueueType: enumspb.TASK_QUEUE_TYPE_WORKFLOW,
},
})
s.Require().NoError(err)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also removed a few s.Require(). which are unnecessary

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.

2 participants