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

Coroutine context is not cleared properly #54

Closed
rocketraman opened this issue Dec 6, 2023 · 0 comments · Fixed by #55
Closed

Coroutine context is not cleared properly #54

rocketraman opened this issue Dec 6, 2023 · 0 comments · Fixed by #55
Assignees
Labels
Milestone

Comments

@rocketraman
Copy link
Member

The coroutine context is not cleared properly. This test fails:

  @Test
  fun `Context is restored after a context block is complete`() = runBlocking {
    assertTrue(ContextMap.empty)
    assertTrue(ContextStack.empty)
    withContext(CoroutineThreadContext(ThreadContextData(mapOf("myKey" to "myValue"), listOf("test")))) {
      assertEquals("myValue", ContextMap["myKey"])
      assertEquals("test", ContextStack.peek())
    }
    assertTrue(ContextMap.empty)
    assertTrue(ContextStack.empty)
  }
@rocketraman rocketraman self-assigned this Dec 6, 2023
@rocketraman rocketraman added the bug label Dec 6, 2023
@vy vy added this to the 13.0.1 milestone Dec 7, 2023
@ppkarwasz ppkarwasz modified the milestones: 1.3.1, 1.4.0 Dec 27, 2023
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 a pull request may close this issue.

3 participants