Skip to content

Commit

Permalink
Optimize the concurrency unit tests in sqllin-dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoyuang committed Oct 31, 2023
1 parent 4855581 commit 9aac6dd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,21 @@ class CommonBasicTest(private val path: DatabasePath) {
database suspendedScope {
statement = BookTable { table ->
table INSERT listOf(book1, book2)
delay(100)
table SELECT X
}
}

assertEquals(true, statement!!.getResults().any { it == book1 })
assertEquals(true, statement!!.getResults().any { it == book2 })
}
delay(100)
launch {
val book1NewPrice = 18.96
val book2NewPrice = 21.95
val newBook1 = Book(name = "The Da Vinci Code", author = "Dan Brown", pages = 454, price = book1NewPrice)
val newBook2 = Book(name = "The Lost Symbol", author = "Dan Brown", pages = 510, price = book2NewPrice)
var newResult: SelectStatement<Book>? = null
delay(50)
database suspendedScope {
newResult = transaction {
BookTable { table ->
Expand Down

0 comments on commit 9aac6dd

Please sign in to comment.