Skip to content
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

bug fix: OutOfMemoryError #210

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.testcontainers.containers.DockerComposeContainer;

import java.io.IOException;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;

Expand Down Expand Up @@ -38,7 +39,8 @@ public class RocketMQExtension implements BeforeAllCallback {

static {
try {
TEMP_FILE = Files.createTempFile(null, null);
Path tempDirectory = Files.createTempDirectory(String.valueOf(System.currentTimeMillis()));
TEMP_FILE = Files.createTempFile(tempDirectory, null, null);
Files.writeString(TEMP_FILE, DOCKER_COMPOSE);
} catch (IOException e) {
throw new RuntimeException(e);
Expand All @@ -52,8 +54,9 @@ public class RocketMQExtension implements BeforeAllCallback {
.withExposedService("namesrv_1", 9876);

@Override
public void beforeAll(ExtensionContext extensionContext) {
public void beforeAll(ExtensionContext extensionContext) throws Exception {
rocketmqContainer.start();
Files.deleteIfExists(TEMP_FILE);
String nameSrvUrl = rocketmqContainer.getServiceHost("namesrv_1", 9876)
+ ":" +
rocketmqContainer.getServicePort("namesrv_1", 9876);
Expand Down
Loading