Skip to content

ConcurrentWeakMapOperationStressTest.testOperation failed on CI #3341

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

Closed
qwwdfsad opened this issue Jun 23, 2022 · 7 comments
Closed

ConcurrentWeakMapOperationStressTest.testOperation failed on CI #3341

qwwdfsad opened this issue Jun 23, 2022 · 7 comments
Assignees
Labels

Comments

@qwwdfsad
Copy link
Collaborator

https://teamcity.jetbrains.com/viewLog.html?buildId=3878037&tab=buildResultsDiv&buildTypeId=KotlinTools_KotlinxCoroutines_NightlyStress

java.lang.AssertionError: expected:<0> but was:<1>
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.failNotEquals(Assert.java:835)
	at org.junit.Assert.assertEquals(Assert.java:120)
	at kotlin.test.junit.JUnitAsserter.assertEquals(JUnitSupport.kt:32)
	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals(Assertions.kt:63)
	at kotlin.test.AssertionsKt.assertEquals(Unknown Source)
	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals$default(Assertions.kt:62)
	at kotlin.test.AssertionsKt.assertEquals$default(Unknown Source)
	at kotlinx.coroutines.internal.ConcurrentWeakMapOperationStressTest.testOperations(ConcurrentWeakMapOperationStressTest.kt:71)
@qwwdfsad qwwdfsad self-assigned this Jun 23, 2022
@qwwdfsad qwwdfsad added the build label Jun 23, 2022
@qwwdfsad
Copy link
Collaborator Author

It doesn't reproduce locally and also has nothing in common with #2187

@qwwdfsad
Copy link
Collaborator Author

Another observation is that assertEquals(v, m[k]) failed, so it may appear that value was prematurely deleted.
But it's not the case, because the very last assert assertEquals(0, m.size) failed with 0 != 1, which likely means that it is possible to observe map in such intermediates state that the key is here, but get returns null

@dkhalanskyjb
Copy link
Collaborator

It doesn't reproduce locally

Just to double-check, I tried running this test in a loop on Linux, and 20 minutes later, with nSeconds = 75, the bug did not surface.

@qwwdfsad
Copy link
Collaborator Author

qwwdfsad commented Jun 24, 2022

Sorry to bother, I've actually found the bug and working on a more concise reproducer

@qwwdfsad
Copy link
Collaborator Author

The longer I stare at it, the less I believe it's a bug in our implementation. I've studied the implementation once again, and it doesn't seem possible it can reasonably make this very test fail, the test itself also looks reasonable.

I've added an additional diagnostics, let's see if it fails ever again

@dkhalanskyjb
Copy link
Collaborator

I left the test to run in a loop for 2 days and 20 hours, but it still didn't crash.

@qwwdfsad
Copy link
Collaborator Author

Closing as "cannot reproduce", let's reopen it if it indeed was a real failure that will appear again and not a random fluke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants