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

Support alternate testContextHolder for TestContextManager #32898

Closed
Kantis opened this issue May 26, 2024 · 3 comments
Closed

Support alternate testContextHolder for TestContextManager #32898

Kantis opened this issue May 26, 2024 · 3 comments
Assignees
Labels
in: test Issues in the test module theme: kotlin An issue related to Kotlin support

Comments

@Kantis
Copy link

Kantis commented May 26, 2024

Kotest is a Kotlin based testing framework. We execute tests on coroutines, which may (or may not) execute on different threads. As such, the TestContextManager created for a certain class cannot reliably store the TestContext as a ThreadLocal.

We recently received an issue regarding this.

Could you consider providing the means to provide other storage alternatives?

Simply letting us inject or access the ThreadLocal should be sufficient, since we could then add it as a coroutine context element which the coroutine machinery would then take care of.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 26, 2024
@bclozel bclozel added the in: test Issues in the test module label May 26, 2024
@sbrannen sbrannen changed the title Support alternate TestContextHolder for TestContextManager Support alternate testContextHolder for TestContextManager Jun 4, 2024
@sbrannen sbrannen added the theme: kotlin An issue related to Kotlin support label Jun 4, 2024
@sbrannen sbrannen self-assigned this Jul 8, 2024
@sbrannen
Copy link
Member

sbrannen commented Jul 8, 2024

Hi @Kantis,

Simply letting us inject or access the ThreadLocal should be sufficient, since we could then add it as a coroutine context element which the coroutine machinery would then take care of.

Would it be sufficient for Kotest if we introduce a new TestContextManager constructor (or constructors) that allow you to supply a ThreadLocal<TestContext> testContextHolder?

@sbrannen sbrannen added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 8, 2024
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jul 15, 2024
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module theme: kotlin An issue related to Kotlin support
Projects
None yet
Development

No branches or pull requests

4 participants