Skip to content

Remove use of require assertions inside Eventually calls#31112

Merged
zmb3 merged 3 commits intomasterfrom
zmb3/eventually-assert
Aug 30, 2023
Merged

Remove use of require assertions inside Eventually calls#31112
zmb3 merged 3 commits intomasterfrom
zmb3/eventually-assert

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Aug 28, 2023

require.Eventually runs the predicate function in a background goroutine. It is invalid to use require to make assertions inside the eventually, because require will fail the test if the assertion fails, and tests can only be failed from the test's main goroutine.

Comment thread lib/cache/cache_test.go Outdated
Comment thread lib/cache/cache_test.go Outdated
@zmb3 zmb3 force-pushed the zmb3/eventually-assert branch from 403915b to 4c623d5 Compare August 28, 2023 20:31
Comment thread integration/ec2_test.go Outdated
require.Eventually runs the predicate function in a background
goroutine. It is invalid to use require to make assertions
inside the eventually, because require will fail the test if the
assertion fails, and tests can only be failed from the test's
main goroutine.
@zmb3 zmb3 force-pushed the zmb3/eventually-assert branch from 4c623d5 to 3eabe9b Compare August 30, 2023 13:05
@zmb3
Copy link
Copy Markdown
Collaborator Author

zmb3 commented Aug 30, 2023

@strideynet thanks for the pointer - I've come to the conclusion that we should almost always prefer EventuallyWithT. LMK what you think about the latest commit.

@zmb3 zmb3 requested a review from rosstimothy August 30, 2023 13:10
Comment thread integration/appaccess/pack.go Outdated
@zmb3 zmb3 force-pushed the zmb3/eventually-assert branch from a894035 to b5e35a8 Compare August 30, 2023 16:18
@zmb3 zmb3 added this pull request to the merge queue Aug 30, 2023
Merged via the queue into master with commit c3e6173 Aug 30, 2023
@zmb3 zmb3 deleted the zmb3/eventually-assert branch August 30, 2023 17:13
@public-teleport-github-review-bot
Copy link
Copy Markdown

@zmb3 See the table below for backport results.

Branch Result
branch/v12 Failed
branch/v13 Failed
branch/v14 Create PR

jakule pushed a commit that referenced this pull request Oct 18, 2023
This commit contains:
- a refactoring of the model action logic to be exposed through the
  `DoAction` function
- Expose `RunTool()` capability through ai.Client and assist.Assist
- Add the "audit-query" action that invokes directly the audit
  generation tool
github-merge-queue Bot pushed a commit that referenced this pull request Oct 19, 2023
* Add the ability to run a specific tool to Assist. (#31112)

This commit contains:
- a refactoring of the model action logic to be exposed through the
  `DoAction` function
- Expose `RunTool()` capability through ai.Client and assist.Assist
- Add the "audit-query" action that invokes directly the audit
  generation tool

* stream audit query responses (#31092)

* stream audit query responses

* fixup! stream audit query responses

* fixup! fixup! stream audit query responses

---------

Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants