Forum Discussion

akanksha0814's avatar
akanksha0814
Regular Visitor
2 years ago

Cucumber test hung after upgrading from 6.10.4 to 7.8.1

I am using below piece of code to run cucumber fearture from cli,

private Runtime runCucumber(String[] arguments) throws IOException {
        clearCachedTestContext();
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        CommandlineOptionsParser commandlineOptionsParser = new CommandlineOptionsParser(outputStream);
        //RuntimeOptions runtimeOptions = commandlineOptionsParser.parse(arguments).addDefaultGlueIfAbsent().addDefaultFeaturePathIfAbsent().addDefaultFormatterIfAbsent().addDefaultSummaryPrinterIfAbsent().enablePublishPlugin().build();       
        RuntimeOptions runtimeOptions = commandlineOptionsParser.parse(arguments).addDefaultSummaryPrinterIfNotDisabled().addDefaultGlueIfAbsent().addDefaultFeaturePathIfAbsent().enablePublishPlugin().build();


        Optional<Byte> exitStatus = commandlineOptionsParser.exitStatus();
        if (exitStatus.isPresent()) {
            outputStream.flush();
            throw new ScenarioExecutorException(String.format("Error parsing Cucumber arguments: %s", outputStream.toString()));
        } else {
            Runtime runtime = Runtime.builder().withRuntimeOptions(runtimeOptions).withClassLoader(() -> classLoader).build();
            runtime.run();
            outputStream.flush();
            return runtime;
        }
    }

After upgrading cucumber version, the only changes done is

RuntimeOptions runtimeOptions = commandlineOptionsParser.parse(arguments).addDefaultGlueIfAbsent().addDefaultFeaturePathIfAbsent().addDefaultFormatterIfAbsent().addDefaultSummaryPrinterIfAbsent().enablePublishPlugin().build();       

to 

RuntimeOptions runtimeOptions = commandlineOptionsParser.parse(arguments).addDefaultSummaryPrinterIfNotDisabled().addDefaultGlueIfAbsent().addDefaultFeaturePathIfAbsent().enablePublishPlugin().build();

The issue I am facing after the upgrade is its getting hung at 

runtime.run()

and never getting out of it. Log are also not showing any exception or error,

{"@timestamp":"2022-12-08T12:23:00.661Z","@version":"1","message":"Sending run test started event","logger_name":"io.cucumber.core.runtime.CucumberExecutionContext","thread_name":"pool-9-thread-1","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx"}
{"@timestamp":"2022-12-08T12:23:00.661Z","@version":"1","message":"  setAutoCommit = true","logger_name":"org.postgresql.jdbc.PgConnection","thread_name":"https-jsse-nio-8288-exec-4","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx","tracectx.tenantid":"d4d9671c-dde1-44b8-a72d-ba8fe0e22764","tracectx.transactionid":"49f70585-1630-4917-92ac-0c27271583a1"}
{"@timestamp":"2022-12-08T12:23:00.662Z","@version":"1","message":"  setReadOnly = false","logger_name":"org.postgresql.jdbc.PgConnection","thread_name":"https-jsse-nio-8288-exec-4","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx","tracectx.tenantid":"d4d9671c-dde1-44b8-a72d-ba8fe0e22764","tracectx.transactionid":"49f70585-1630-4917-92ac-0c27271583a1"}
{"@timestamp":"2022-12-08T12:23:00.675Z","@version":"1","message":"  setAutoCommit = true","logger_name":"org.postgresql.jdbc.PgConnection","thread_name":"https-jsse-nio-8288-exec-9","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx","tracectx.tenantid":"d4d9671c-dde1-44b8-a72d-ba8fe0e22764","tracectx.transactionid":"a9a2d5b9-75b3-4e3a-8c45-233953dc4737"}
{"@timestamp":"2022-12-08T12:23:00.675Z","@version":"1","message":"  setReadOnly = false","logger_name":"org.postgresql.jdbc.PgConnection","thread_name":"https-jsse-nio-8288-exec-9","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx","tracectx.tenantid":"d4d9671c-dde1-44b8-a72d-ba8fe0e22764","tracectx.transactionid":"a9a2d5b9-75b3-4e3a-8c45-233953dc4737"}{"@timestamp":"2022-12-08T12:23:00.769Z","@version":"1","message":"Loading glue from [classpath:com/accantosystems/stratoss/doki/scenariorunner/cucumber/steps]","logger_name":"io.cucumber.core.runner.Runner","thread_name":"pool-9-thread-1","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx"}
{"@timestamp":"2022-12-08T12:23:00.770Z","@version":"1","message":"Loading glue for backend io.cucumber.java.JavaBackend","logger_name":"io.cucumber.core.runner.Runner","thread_name":"pool-9-thread-1","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx"}
{"@timestamp":"2022-12-08T12:23:00.940Z","@version":"1","message":"Loading glue for backend io.cucumber.spring.SpringBackend","logger_name":"io.cucumber.core.runner.Runner","thread_name":"pool-9-thread-1","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx"}
{"@timestamp":"2022-12-08T12:23:00.990Z","@version":"1","message":"Loading features from file:/home/ibmalm/target/tmp_features/6d7e606c-a4ca-45ed-8ccf-dc4310526723.feature","logger_name":"io.cucumber.core.runtime.FeaturePathFeatureSupplier","thread_name":"pool-9-thread-1","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx"}
{"@timestamp":"2022-12-08T12:23:01.175Z","@version":"1","message":"Sending test source read event for file:///home/ibmalm/target/tmp_features/6d7e606c-a4ca-45ed-8ccf-dc4310526723.feature","logger_name":"io.cucumber.core.runtime.CucumberExecutionContext","thread_name":"pool-9-thread-1","level":"DEBUG","level_value":10000,"INSTANCE_ID":"Doki:cp4na-o-doki-74756bddd4-w9gpx"}

 

No RepliesBe the first to reply