Skip to content

Commit

Permalink
Fixes #24520: Async tests are failing for node certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
clarktsiory committed Mar 18, 2024
1 parent 7bb2989 commit 71358cc
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import org.junit.runner.RunWith
import org.slf4j.LoggerFactory
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import zio._

@RunWith(classOf[JUnitRunner])
class TestWriteNodeCertificatesPem extends Specification {
Expand Down Expand Up @@ -181,11 +182,10 @@ class TestWriteNodeCertificatesPem extends Specification {
// exec
writer.writeCerticatesAsync(dest, nodes)

Thread.sleep(100)

val output = new String(os.toByteArray, StandardCharsets.UTF_8)

(output must beMatching("""(?s).*Unexpected: Error when executing reload command.*code: -2147483648.*""".r)) and
(dest.contentAsString(StandardCharsets.UTF_8) must beEqualTo(cert1 + "\n" + cert2 + "\n"))
(new String(os.toByteArray, StandardCharsets.UTF_8) must beMatching(
"""(?s).*Unexpected: Error when executing reload command.*code: -2147483648.*""".r
)
.eventually(10, 100.millis.asScala)) and
(dest.contentAsString(StandardCharsets.UTF_8) must beEqualTo(cert1 + "\n" + cert2 + "\n").eventually(10, 100.millis.asScala))
}
}

0 comments on commit 71358cc

Please sign in to comment.