Skip to content

Commit aab7041

Browse files
committed
Update test name
1 parent 52e0186 commit aab7041

8 files changed

Lines changed: 29 additions & 29 deletions

File tree

‎modules/mysql/shared/src/test/scala/ldbc/mysql/ReadTimeoutClosesConnectionTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ReadTimeoutClosesConnectionTest extends FTestPlatform:
4545
second <- conn.createStatement().flatMap(_.executeQuery("SELECT 1")).attempt
4646
yield second.left.exists(_.getMessage.contains("transport has failed"))
4747
},
48-
"故障後の文が fail-fast していない"
48+
"a statement on a failed transport did not fail fast"
4949
)
5050

5151
test("a healthy connection is not marked closed"):

‎modules/mysql/shared/src/test/scala/ldbc/mysql/TransportFailureSilenceTest.scala‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class TransportFailureSilenceTest extends FTestPlatform:
108108
closed <- connection.isClosed()
109109
yield (written.size, closed)
110110

111-
assertFx(program, (0, true), "故障した接続の close() がネットワークに書き込んでいる")
111+
assertFx(program, (0, true), "close() on a failed connection still wrote to the network")
112112

113113
test("StreamingResultSet.next() on a failed transport writes nothing"):
114114
val program = for
@@ -118,7 +118,7 @@ class TransportFailureSilenceTest extends FTestPlatform:
118118
written <- pair._2.get
119119
yield (outcome.left.exists(_.isInstanceOf[SQLTransientConnectionException]), written.size)
120120

121-
assertFx(program, (true, 0), "故障後の next() が COM_STMT_FETCH を送っている")
121+
assertFx(program, (true, 0), "next() after a failure still sent COM_STMT_FETCH")
122122

123123
test("a healthy StreamingResultSet still fetches"):
124124
val program = for
@@ -128,4 +128,4 @@ class TransportFailureSilenceTest extends FTestPlatform:
128128
written <- pair._2.get
129129
yield written.size
130130

131-
assertFxBoolean(program.map(_ > 0), "健全な接続で next() が一度もソケットに書いていない")
131+
assertFxBoolean(program.map(_ > 0), "next() on a healthy connection never wrote to the socket")

‎modules/mysql/shared/src/test/scala/ldbc/mysql/net/BitVectorSocketEofTest.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class BitVectorSocketEofTest extends FTestPlatform:
4242
outcome <- socket.read(4).attempt
4343
yield outcome.left.map(_.getClass.getSimpleName).left.getOrElse("succeeded unexpectedly")
4444

45-
assertFx(program, "EofException", "EOF がタイムアウトとして報告されている")
45+
assertFx(program, "EofException", "end of stream is still reported as a timeout")
4646

4747
test("EofException reports how many bytes were requested and how many arrived"):
4848
val program = for
4949
socket <- socketOver(List(Array[Byte](1, 2, 3)))
5050
outcome <- socket.read(8).attempt
5151
yield outcome.left.toOption.collect { case eof: EofException => (eof.bytesRequested, eof.bytesRead) }
5252

53-
assertFx(program, Some((8, 3)), "EofException が要求バイト数と既読バイト数を正しく持っていない")
53+
assertFx(program, Some((8, 3)), "EofException does not carry the expected and received byte counts")
5454

5555
test("end of stream is not reported as SQLTimeoutException"):
5656
val program = for

‎modules/mysql/shared/src/test/scala/ldbc/mysql/net/TransportFailureTest.scala‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class TransportFailureTest extends FTestPlatform:
9494
failed <- pair._2.get
9595
yield failed
9696

97-
assertFx(program, true, "PacketTooBigException が故障として記録されていない")
97+
assertFx(program, true, "PacketTooBigException was not recorded as a transport failure")
9898

9999
test("a payload the decoder rejects marks the transport as failed"):
100100
val garbage = ByteVector(Array[Byte](0x7f, 0x01, 0x02)).toBitVector
@@ -105,7 +105,7 @@ class TransportFailureTest extends FTestPlatform:
105105
failed <- pair._2.get
106106
yield failed
107107

108-
assertFx(program, true, "デコード失敗が故障として記録されていない")
108+
assertFx(program, true, "a decode failure was not recorded as a transport failure")
109109

110110
test("cancelling a receive marks the transport as failed"):
111111
val program = for
@@ -117,7 +117,7 @@ class TransportFailureTest extends FTestPlatform:
117117
failed <- pair._2.get
118118
yield failed
119119

120-
assertFx(program, true, "キャンセルされた receive が故障として記録されていない")
120+
assertFx(program, true, "a cancelled receive was not recorded as a transport failure")
121121

122122
test("a packet that decodes cleanly leaves the transport usable"):
123123
val program = for
@@ -127,7 +127,7 @@ class TransportFailureTest extends FTestPlatform:
127127
failed <- pair._2.get
128128
yield (received.isInstanceOf[OKPacket], failed)
129129

130-
assertFx(program, (true, false), "正常にデコードできたのに故障として記録されている")
130+
assertFx(program, (true, false), "a successfully decoded packet was recorded as a transport failure")
131131

132132
test("a successful send leaves the transport usable"):
133133
val program = for

‎modules/net/js/src/test/scala/ldbc/net/NodeReadCancellationTest.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class NodeReadCancellationTest extends munit.FunSuite:
6060
firstCalled = Promise[String]()
6161
canceler = raw.read(4, r => { if !firstCalled.isCompleted then firstCalled.success(s"called: $r"); () })
6262
_ <- delay(200)
63-
_ = assert(!firstCalled.isCompleted, "データが無いのに1回目の read が完了している")
63+
_ = assert(!firstCalled.isCompleted, "the first read completed even though no data had arrived")
6464

6565
_ = canceler.cancel()
6666
_ <- delay(100)
@@ -82,5 +82,5 @@ class NodeReadCancellationTest extends munit.FunSuite:
8282
yield
8383
raw.close()
8484
server.close()
85-
assertEquals(got, "AAAABBBB", s"キャンセルした read がバイトを捨てている(読めたのは '$got')")
85+
assertEquals(got, "AAAABBBB", s"a cancelled read discarded bytes (only '$got' was left)")
8686
}

‎modules/net/jvm-native/src/test/scala/ldbc/net/RawSocketCancellationTest.scala‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ class RawSocketCancellationTest extends munit.FunSuite:
3131
var waited = 0
3232
while accepted.get() == null && waited < 10000 do { Thread.sleep(25); waited += 25 }
3333
val socket = accepted.get()
34-
assert(socket != null, "サーバが accept できなかった")
34+
assert(socket != null, "the server never accepted a connection")
3535
socket
3636

3737
private def connectRaw(port: Int): RawSocket =
3838
val ref = new AtomicReference[Either[Throwable, RawSocket]](null)
3939
val latch = new CountDownLatch(1)
4040
engine.connect("127.0.0.1", port, SocketOptions.default, r => { ref.set(r); latch.countDown() })
41-
assert(latch.await(10, TimeUnit.SECONDS), "connect がタイムアウトした")
42-
ref.get().fold(e => fail(s"connect 失敗: $e"), identity)
41+
assert(latch.await(10, TimeUnit.SECONDS), "connect timed out")
42+
ref.get().fold(e => fail(s"connect failed: $e"), identity)
4343

4444
test("cancelling a read leaves the bytes for the next read"):
4545
val (port, accepted) = acceptOne()
@@ -49,7 +49,7 @@ class RawSocketCancellationTest extends munit.FunSuite:
4949
val firstCallback = new AtomicReference[String]("not called")
5050
val canceler = client.read(4, r => firstCallback.set(s"called: $r"))
5151
Thread.sleep(300)
52-
assertEquals(firstCallback.get(), "not called", "データが無いのに1回目の read が完了している")
52+
assertEquals(firstCallback.get(), "not called", "the first read completed even though no data had arrived")
5353

5454
canceler.cancel()
5555
Thread.sleep(300)
@@ -71,7 +71,7 @@ class RawSocketCancellationTest extends munit.FunSuite:
7171
val got = if secondLatch.await(5, TimeUnit.SECONDS) then secondRef.get() else "timed out"
7272
client.close()
7373

74-
assertEquals(got, "AAAABBBB", s"キャンセルした read がバイトを消費して捨てている(読めたのは '$got')")
74+
assertEquals(got, "AAAABBBB", s"a cancelled read consumed and discarded bytes (only '$got' was left)")
7575

7676
test("cancelling a write still transfers every byte"):
7777
val (port, accepted) = acceptOne()
@@ -85,7 +85,7 @@ class RawSocketCancellationTest extends munit.FunSuite:
8585
val canceler = client.write(payload, _ => writeDone.set(true))
8686

8787
Thread.sleep(500)
88-
assert(!writeDone.get(), "ペイロードが小さすぎて部分書き込みが起きていない(テストの前提が崩れている)")
88+
assert(!writeDone.get(), "the payload was too small to force a partial write, so this test proves nothing")
8989

9090
canceler.cancel()
9191

@@ -109,5 +109,5 @@ class RawSocketCancellationTest extends munit.FunSuite:
109109
assertEquals(
110110
received.get(),
111111
size,
112-
s"キャンセルされた write が途中で打ち切られている(${ received.get() } / $size バイトしか届いていない)"
112+
s"a cancelled write stopped midway (${ received.get() } of $size bytes arrived)"
113113
)

‎modules/net/jvm/src/test/scala/ldbc/net/SocketOptionsTest.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class SocketOptionsTest extends munit.FunSuite:
3636
applied(SocketOptions(sendBufferSize = Some(requested), receiveBufferSize = Some(requested))): ch =>
3737
val send = ch.getOption(StandardSocketOptions.SO_SNDBUF).intValue
3838
val recv = ch.getOption(StandardSocketOptions.SO_RCVBUF).intValue
39-
assert(send > default._1, s"sendBufferSize がソケットに届いていない(既定 ${ default._1 } / 指定後 $send)")
40-
assert(recv > default._2, s"receiveBufferSize がソケットに届いていない(既定 ${ default._2 } / 指定後 $recv)")
39+
assert(send > default._1, s"sendBufferSize never reached the socket (default ${ default._1 }, applied $send)")
40+
assert(recv > default._2, s"receiveBufferSize never reached the socket (default ${ default._2 }, applied $recv)")
4141

4242
test("leaving the buffer sizes unset keeps the platform defaults"):
4343
val untouched = SocketChannel.open()

‎modules/pool/shared/src/test/scala/ldbc/pool/DeadConnectionEvictionTest.scala‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class DeadConnectionEvictionTest extends FxSuite:
3737
}
3838
validations <- mock.validationCount.get
3939
yield
40-
assertEquals(status.idle, 0, "死亡した接続がアイドルとしてプールに戻っている")
41-
assertEquals(status.total, 0, "死亡した接続がプールから除去されていない")
42-
assertEquals(validations, 0, "バイパス窓の中なのに検証の往復が走っている(バイパスが効いていない)")
40+
assertEquals(status.idle, 0, "a dead connection went back into the pool as idle")
41+
assertEquals(status.total, 0, "a dead connection was not removed from the pool")
42+
assertEquals(validations, 0, "a validation round trip ran inside the bypass window, so the bypass is not working")
4343
}
4444

4545
test("a connection that died while idle is evicted on lease, even inside aliveBypassWindow") {
@@ -57,8 +57,8 @@ class DeadConnectionEvictionTest extends FxSuite:
5757
}
5858
total <- created.get.map(_.size)
5959
yield
60-
assertEquals(leasedWasClosed, false, "死亡した接続がリース時に除去されず、そのまま払い出されている")
61-
assert(total >= 2, s"死亡した接続を捨てたあと代替が生成されていない(生成数: $total)")
60+
assertEquals(leasedWasClosed, false, "a dead connection was handed out instead of being evicted on lease")
61+
assert(total >= 2, s"no replacement was created after discarding the dead connection ($total created)")
6262
}
6363

6464
test("a healthy connection is still pooled inside aliveBypassWindow") {
@@ -69,9 +69,9 @@ class DeadConnectionEvictionTest extends FxSuite:
6969
}
7070
validations <- mock.validationCount.get
7171
yield
72-
assertEquals(status.idle, 1, "健全な接続が不必要に除去されている")
72+
assertEquals(status.idle, 1, "a healthy connection was evicted for no reason")
7373
assertEquals(status.total, 1)
74-
assertEquals(validations, 1, "テスト自身の isValid 以外に検証の往復が走っている")
74+
assertEquals(validations, 1, "a validation round trip ran beyond the isValid this test performs itself")
7575
}
7676

7777
test("with the bypass disabled the validation round trip does run") {
@@ -82,5 +82,5 @@ class DeadConnectionEvictionTest extends FxSuite:
8282
datasource.use(_ => Fx.unit) >> datasource.status
8383
}
8484
validations <- mock.validationCount.get
85-
yield assert(validations > 0, "aliveBypassWindow = 0 でも検証の往復が走っていない")
85+
yield assert(validations > 0, "no validation round trip ran even with aliveBypassWindow = 0")
8686
}

0 commit comments

Comments
 (0)