gauge-java icon indicating copy to clipboard operation
gauge-java copied to clipboard

Running Gauge sample on command line runs forever without error

Open MariusSchmidt opened this issue 4 years ago • 5 comments

Describe the bug I freshly installed gauge on command line via apt-get. I installed Gauge Java using "gauge install java". I created a sample project in /tmp/gaugesample

To Reproduce Steps (or project) to reproduce the behavior: /tmp$ mkdir gaugesample /tmp$ cd gaugesample/ /tmp/gaugesample$ gauge init java Initializing template from https://github.com/getgauge/template-java/releases/latest/download/java.zip . Copying Gauge template java to current directory ... Successfully initialized the project. Run specifications with "gauge run specs/". /tmp/gaugesample$ gauge run specs/

Logs

logs/javac.out is empty

logs/java.out:

{"logLevel":"debug","message":"multithreading is set to false"}
{"logLevel":"debug","message":"Using reflection to scan dependencies for gauge implementations..."}
{"logLevel":"debug","message":"gauge-java took 377milliseconds to load and scan. This should be less than 'runner_connection_timeout' config value."}
{"logLevel":"debug","message":"run 'gauge config runner_connection_timeout' and verify that it is < 377"}
{"logLevel":"debug","message":"starting gRPC server..."}
{"logLevel":"debug","message":"started gRPC server on port 42189"}
{"logLevel":"info","message":"Listening on port:42189"}
{"logLevel":"debug","message":"Scanning packages for steps"}

logs/gauge.log

14-01-2021 22:12:47.571 [Gauge] [DEBUG] Created gauge_screenshots_dir at /tmp/gaugesample/.gauge/screenshots
14-01-2021 22:12:47.572 [Gauge] [DEBUG] Plugin java is already installed.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] Plugin html-report is already installed.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] Parsing started.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] Started concepts parsing.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] 0 concepts parsing completed.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] Started specifications parsing.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] 1 specifications parsing completed.
14-01-2021 22:12:47.572 [Gauge] [DEBUG] Parsing completed.
14-01-2021 22:12:47.573 [java] [DEBUG] ***** Printing Properties/Env Values *****
14-01-2021 22:12:47.573 [java] [DEBUG] PATH: /home/mariuss/.pyenv/plugins/pyenv-virtualenv/shims:/home/mariuss/.pyenv/shims:/home/mariuss/.pyenv/bin:/home/mariuss/.nvm/versions/node/v12.18.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mariuss/.gauge/plugins/screenshot/0.0.1
14-01-2021 22:12:47.573 [java] [DEBUG] JAVA_HOME: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_project_root: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_parallel_streams_count: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_reports_dir: reports
14-01-2021 22:12:47.573 [java] [DEBUG] overwrite_reports: true
14-01-2021 22:12:47.573 [java] [DEBUG] logs_directory: logs
14-01-2021 22:12:47.573 [java] [DEBUG] enable_multithreading: false
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_specs_dir: specs
14-01-2021 22:12:47.573 [java] [DEBUG] csv_delimiter: ,
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_java_home: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_custom_build_path: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_additional_libs: libs/*
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_jvm_args: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_custom_compile_dir: 
14-01-2021 22:12:47.573 [java] [DEBUG] gauge_clear_state_level: scenario
14-01-2021 22:12:47.573 [java] [DEBUG] ***** END *****
14-01-2021 22:12:47.574 [java] [DEBUG] running - javac [-encoding UTF-8 -d gauge_bin @/tmp/gauge_temp783708444/52fdfc072182654f163f5f0f9a621d72]
14-01-2021 22:12:47.574 [java] [DEBUG] stdout/stderr is logged to logs/20633-javac.out
14-01-2021 22:12:47.774 [Gauge] [DEBUG] Checking updates...
14-01-2021 22:12:47.774 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/html-report?l=java&p=html-report,java,screenshot&o=linux&a=amd64
14-01-2021 22:12:48.140 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/java?l=java&p=html-report,java,screenshot&o=linux&a=amd64
14-01-2021 22:12:48.169 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/screenshot?l=java&p=html-report,java,screenshot&o=linux&a=amd64
14-01-2021 22:12:48.198 [java] [DEBUG] classpath set to /home/mariuss/.gauge/plugins/java/0.7.12/*:/home/mariuss/.gauge/plugins/java/0.7.12/libs/*:/tmp/gaugesample/libs/*:gauge_bin
14-01-2021 22:12:48.198 [java] [DEBUG] found java executable in java
14-01-2021 22:12:48.198 [java] [DEBUG] running - java [-Dfile.encoding=UTF-8 com.thoughtworks.gauge.GaugeRuntime --start]
14-01-2021 22:12:48.198 [java] [DEBUG] stdout/stderr is logged to logs/20633-java.out
14-01-2021 22:12:48.252 [java] [DEBUG] multithreading is set to false
14-01-2021 22:12:48.410 [java] [DEBUG] Using reflection to scan dependencies for gauge implementations...
14-01-2021 22:12:48.629 [java] [DEBUG] gauge-java took 377milliseconds to load and scan. This should be less than 'runner_connection_timeout' config value.
14-01-2021 22:12:48.629 [java] [DEBUG] run 'gauge config runner_connection_timeout' and verify that it is < 377
14-01-2021 22:12:48.629 [java] [DEBUG] starting gRPC server...
14-01-2021 22:12:48.672 [java] [DEBUG] started gRPC server on port 42189
14-01-2021 22:12:48.672 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 42189
14-01-2021 22:12:48.723 [Gauge] [DEBUG] Successfully made the connection with runner with port: 42189
14-01-2021 22:12:48.723 [Gauge] [DEBUG] Validation started.
14-01-2021 22:12:48.996 [java] [DEBUG] Scanning packages for steps

Expected behavior See output as it used to be

# Specification Heading
  ## Vowel counts in single word         ✔ ✔
  ## Vowel counts in multiple word       ✔ ✔

Successfully generated html-report to => /tmp/gaugesample/reports/html-report/index.html

Specifications: 1 executed      1 passed        0 failed        0 skipped
Scenarios:      2 executed      2 passed        0 failed        0 skipped

Screenshots If applicable, add screenshots to help explain your problem.

Versions: Operating System: Kubuntu 20.04 KDE Plasma Version: 5.18.5 KDE Frameworks Version: 5.68.0 Qt Version: 5.12.8 Kernel Version: 5.4.0-60-generic OS Type: 64-bit Processors: 32 × AMD Ryzen 9 3950X 16-Core Processor Memory: 31,3 GiB

mariuss@ezekeel:/tmp/gaugesample$ java -version openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

gauge -v
Gauge version: 1.1.7
Commit Hash: 5d86b72

Plugins
-------
html-report (4.0.12)
java (0.7.13)
screenshot (0.0.1)

Additional context Add any other context about the problem here.

MariusSchmidt avatar Jan 14 '21 21:01 MariusSchmidt

This is strange. I am trying to replicate this but it works fine on my linux as well as docker environments

sriv avatar Jan 19 '21 10:01 sriv

Hi @sriv How to run Specification with Maven enabled gauge java project?

preetipadalia avatar Jan 29 '21 07:01 preetipadalia

@MariusSchmidt im facing the same issue, did you find a solution?

PadillaBraulio avatar Aug 30 '21 07:08 PadillaBraulio

I was actually to finally to fix it but I am not sure, if I remember the right solution. It was for sure setup related. Did you check, that you have the JAVA_HOME environment variable set?

MariusSchmidt avatar Sep 01 '21 20:09 MariusSchmidt

@PadillaBraulio Update: So for a fresh setup with a new additional Java Version (Java 17, installed alongside Java 16, 11 and 8) I ran into the same problem again, default JAVA_HOME was Java 11 but I tried to run the process with Java 17. Setting the JAVA_HOME to the machine actually running the tests (e.g. trough gauge-maven-plugin) made it work.

MariusSchmidt avatar Sep 23 '21 19:09 MariusSchmidt