Skip to content

Commit 02b1cbd

Browse files
committed
Use an invalid output in the Rainbow Gum queueing test for Windows
The test's invalid configuration named a missing encoder. Rainbow Gum 0.16.2 opens the appender's output before resolving the encoder and does not close it when that fails, so application.log stayed open and Windows could not delete the temp directory. An unknown output scheme fails before anything is opened, and the test now checks no log file was created. Requested by Adam Gent.
1 parent cd256c3 commit 02b1cbd

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎modules/jooby-rainbowgum/src/test/java/io/jooby/rainbowgum/RainbowGumServiceTest.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,19 @@ void muteSurvivesBootstrapReplacementDuringServerStartup() {
251251
@Test
252252
void invalidConfigurationKeepsQueueingUntilAValidEnvironment() throws Exception {
253253
var bootstrap = RainbowGum.of();
254+
/*
255+
* An invalid output rather than an invalid encoder: Rainbow Gum 0.16.2 opens the output before
256+
* resolving the encoder and does not close it when that fails, and Windows cannot delete the
257+
* temp directory while the log file is open.
258+
*/
254259
var invalid =
255260
configuration("debug")
256261
.withValue(
257-
"logging.appender.capture.encoder.uri",
258-
ConfigValueFactory.fromAnyRef("missing-encoder"));
262+
"logging.appender.capture.output.uri",
263+
ConfigValueFactory.fromAnyRef("missing-output:///"));
259264
var app = new Jooby();
260265
assertThrows(RuntimeException.class, () -> app.setEnvironment(environment(invalid)));
266+
assertFalse(Files.exists(directory.resolve("application.log")));
261267
assertSame(bootstrap, RainbowGum.of());
262268
LoggerFactory.getLogger("still.queued").info("still-queued");
263269
app.setEnvironment(environment(configuration("debug")));

0 commit comments

Comments
 (0)