Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Mar 5, 2024
1 parent 9759486 commit 29ee1e7
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.testcontainers.lifecycle.Startables;
import org.testcontainers.utility.DockerLoggerFactory;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLClassLoader;
Expand Down Expand Up @@ -67,6 +70,8 @@ protected static String getFenodes() {

@BeforeClass
public static void startContainers() {
test("cat /proc/cpuinfo | grep \"cpu cores\" | uniq");
test("cat /proc/meminfo | grep MemTotal");
LOG.info("Starting doris containers...");
Startables.deepStart(Stream.of(DORIS_CONTAINER)).join();
given().ignoreExceptions()
Expand All @@ -77,6 +82,24 @@ public static void startContainers() {
LOG.info("Containers doris are started.");
}

static void test(String cmd){
try{
Process p = Runtime.getRuntime().exec(cmd);
InputStream is = p.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String line;
while((line = reader.readLine())!= null){
System.out.println(line);
}
p.waitFor();
is.close();
reader.close();
p.destroy();
}catch (Exception e){
e.printStackTrace();
}
}

@AfterClass
public static void stopContainers() {
LOG.info("Stopping doris containers...");
Expand Down

0 comments on commit 29ee1e7

Please sign in to comment.