getgauge / gauge-java

Java runner for Gauge
https://gauge.org
Apache License 2.0
91 stars 47 forks source link

Issue running Gauge with Gauge-Java-Runner in Kubernetes #586

Closed montezuma93 closed 3 years ago

montezuma93 commented 3 years ago

Hi,

we try to run gauge tests along with the gauge-java-runner in Kubernetes. Our setup is a maven spring project, including round about 2000 class files and a few hunderd specs. We try to start a Gauge Container in Kubernetes running these tests, with Jenkins as Tool.

Gauge will successfuly compile the classes, but then will suddenly abort with a strange exception, looking like this:

2021-04-22T16:34:26.471  + gauge run specs/-qadbs-/safetyGrid/contract/creation --env ac1 --tags SafetyGrid --verbose --log-level=debug
2021-04-22T16:34:26.471  gauge run specs/-qadbs-/safetyGrid/contract/creation
2021-04-22T16:34:26.471  env : [ac1]
2021-04-22T16:34:26.471  log-level : [debug]
2021-04-22T16:34:26.471  tags : [SafetyGrid]
2021-04-22T16:34:26.471  verbose : [true]
2021-04-22T16:34:26.471  'gauge_environment' set to 'ac1'
2021-04-22T16:34:26.471  'gauge_environment' set to 'default'
2021-04-22T16:34:26.471  Created gauge_screenshots_dir at /home/jenkins/agent/workspace/_feature_xxx/.gauge/screenshots
2021-04-22T16:34:26.736  Plugin java is already installed.
2021-04-22T16:34:26.736  Plugin html-report is already installed.
2021-04-22T16:34:26.736  Plugin xml-report is already installed.
2021-04-22T16:34:26.736  Installing required plugins.
2021-04-22T16:34:26.736  Installing plugin 'screenshot'
2021-04-22T16:34:26.736  Gathering metadata for screenshot
2021-04-22T16:34:26.736  Downloading https://downloads.gauge.org/plugin/screenshot?l=java&p=html-report,java,xml-report&o=linux&a=amd64
2021-04-22T16:34:26.736  Downloading https://github.com/getgauge/gauge_screenshot/releases/download/v0.0.1/screenshot-0.0.1-linux.x86_64.zip
2021-04-22T16:34:27.268  ........................
2021-04-22T16:34:27.268  Installing plugin screenshot 0.0.1
2021-04-22T16:34:27.268  Successfully installed plugin 'screenshot' version 0.0.1
2021-04-22T16:34:27.268  Parsing started.
2021-04-22T16:34:27.268  Started concepts parsing.
2021-04-22T16:34:39.541  26 concepts parsing completed.
2021-04-22T16:34:39.541  Started specifications parsing.
2021-04-22T16:34:39.541  3 specifications parsing completed.
2021-04-22T16:34:39.541  Applying tags filter: SafetyGrid
2021-04-22T16:34:39.541  The following specifications satisfy filter criteria:
2021-04-22T16:34:39.541  specs/-qadbs-/safetyGrid/contract/creation/ContractActivation.spec
2021-04-22T16:34:39.541  specs/-qadbs-/safetyGrid/contract/creation/ContractCreation.spec
2021-04-22T16:34:39.541  specs/-qadbs-/safetyGrid/contract/creation/ContractItemActivation.spec
2021-04-22T16:34:39.541  Parsing completed.
2021-04-22T16:34:39.541  ***** Printing Properties/Env Values *****
2021-04-22T16:34:39.542  PATH: /home/jenkins/agent/tools/hudson.model.JDK/OPENJDK-13/jdk-13/bin:/home/jenkins/agent/workspace/_feature_xxx@tmp/withMaven1b7c1771:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin:/home/jenkins/.gauge/plugins/screenshot/0.0.1
2021-04-22T16:34:39.542  JAVA_HOME: /home/jenkins/agent/tools/hudson.model.JDK/OPENJDK-13/jdk-13
2021-04-22T16:34:39.542  gauge_project_root: 
2021-04-22T16:34:39.542  gauge_parallel_streams_count: 
2021-04-22T16:34:39.542  gauge_reports_dir: reports
2021-04-22T16:34:39.542  overwrite_reports: true
2021-04-22T16:34:39.542  logs_directory: logs
2021-04-22T16:34:39.542  enable_multithreading: false
2021-04-22T16:34:39.542  gauge_specs_dir: specs
2021-04-22T16:34:39.542  csv_delimiter: ;
2021-04-22T16:34:39.542  gauge_java_home: 
2021-04-22T16:34:39.542  gauge_custom_build_path: 
2021-04-22T16:34:39.542  gauge_additional_libs: libs/*
2021-04-22T16:34:39.542  gauge_jvm_args: 
2021-04-22T16:34:39.542  gauge_custom_compile_dir: 
2021-04-22T16:34:39.542  gauge_clear_state_level: scenario
2021-04-22T16:34:39.542  ***** END *****
2021-04-22T16:34:39.542  Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/home/jenkins/agent/workspace/_feature_xxx@tmp/withMaven1b7c1771/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/home/jenkins/agent/workspace/_feature_xxx@tmp/withMaven1b7c1771"
2021-04-22T16:35:18.335  SIGQUIT: quit
2021-04-22T16:35:18.335  PC=0x499aa8 m=0 sigcode=0
2021-04-22T16:35:18.335  goroutine 1 [syscall]:
2021-04-22T16:35:18.335  syscall.Syscall6(0xf7, 0x1, 0x3ca, 0xc000173a98, 0x1000004, 0x0, 0x0, 0x4acf01, 0xc00019a240, 0xc000173ad8)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/syscall/asm_linux_amd64.s:44
2021-04-22T16:35:18.335  +0x5 fp=0xc000173a48 sp=0xc000173a40 pc=0x499a85
2021-04-22T16:35:18.335  os.(*Process).blockUntilWaitable(0xc0001d60c0, 0x203000, 0xc00017d1e0, 0x1ed)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/os/wait_waitid.go:31 +0x98 fp=0xc000173b38 sp=0xc000173a48 pc=0x4b0838
2021-04-22T16:35:18.335  os.(*Process).wait(0xc0001d60c0, 0x555308, 0x555310, 0x555300)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec_unix.go:22 +0x39 fp=0xc000173bb0 sp=0xc000173b38 pc=0x4ab919
2021-04-22T16:35:18.335  os.(*Process).Wait(...)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec.go:125
2021-04-22T16:35:18.335  os/exec.(*Cmd).Wait(0xc0001d8000, 0x0, 0x0)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec/exec.go:506 +0x60 fp=0xc000173c28 sp=0xc000173bb0 pc=0x4dda60
2021-04-22T16:35:18.335  os/exec.(*Cmd).Run(0xc0001d8000, 0xc00017a3c0, 0x0)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec/exec.go:342 +0x5c fp=0xc000173c50 sp=0xc000173c28 pc=0x4dcedc
2021-04-22T16:35:18.335  os/exec.(*Cmd).Output(0xc0001d8000, 0x3, 0xc000173d10, 0x2, 0x2, 0xc0001d8000)
2021-04-22T16:35:18.335     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec/exec.go:545 +0x88 fp=0xc000173ca8 sp=0xc000173c50 pc=0x4ddda8
2021-04-22T16:35:18.335  main.getGaugeJavaDepFromMavenPom(0xc0001ba1e0, 0x46, 0x576360, 0xc00017d040, 0x0, 0x0)
2021-04-22T16:35:18.335     /home/runner/work/gauge-java/gauge-java/gauge-java.go:131 +0xd0 fp=0xc000173d40 sp=0xc000173ca8 pc=0x4fd270
2021-04-22T16:35:18.336  main.getDepVersionFromBuildFile(0x0, 0x0, 0x411ae6, 0xc00002a0c0, 0x54df1b, 0x12)
2021-04-22T16:35:18.336     /home/runner/work/gauge-java/gauge-java/gauge-java.go:180 +0x19f fp=0xc000173dc0 sp=0xc000173d40 pc=0x4fdbcf
2021-04-22T16:35:18.336  main.validateGaugeJavaVersion()
2021-04-22T16:35:18.336     /home/runner/work/gauge-java/gauge-java/gauge-java.go:208 +0x34 fp=0xc000173e78 sp=0xc000173dc0 pc=0x4fdf94
2021-04-22T16:35:18.336  main.startJava()
2021-04-22T16:35:18.336     /home/runner/work/gauge-java/gauge-java/gauge-java.go:226 +0x34 fp=0xc000173f50 sp=0xc000173e78 pc=0x4fe244
2021-04-22T16:35:18.336  main.main()
2021-04-22T16:35:18.336     /home/runner/work/gauge-java/gauge-java/gauge-java.go:96 +0x2a fp=0xc000173f60 sp=0xc000173f50 pc=0x4fcd8a
2021-04-22T16:35:18.336  runtime.main()
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/runtime/proc.go:203 +0x206 fp=0xc000173fe0 sp=0xc000173f60 pc=0x42d156
2021-04-22T16:35:18.336  runtime.goexit()
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000173fe8 sp=0xc000173fe0 pc=0x457c41
2021-04-22T16:35:18.336  goroutine 18 [syscall]:
2021-04-22T16:35:18.336  os/signal.signal_recv(0x0)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/runtime/sigqueue.go:147 +0x9c
2021-04-22T16:35:18.336  os/signal.loop()
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/os/signal/signal_unix.go:23 +0x22
2021-04-22T16:35:18.336  created by os/signal.init.0
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/os/signal/signal_unix.go:29 +0x41
2021-04-22T16:35:18.336  goroutine 19 [IO wait]:
2021-04-22T16:35:18.336  internal/poll.runtime_pollWait(0x7fcae7069f08, 0x72, 0xffffffffffffffff)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/runtime/netpoll.go:184 +0x55
2021-04-22T16:35:18.336  internal/poll.(*pollDesc).wait(0xc00019a198, 0x72, 0x501, 0x5c2, 0xffffffffffffffff)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/internal/poll/fd_poll_runtime.go:87 +0x45
2021-04-22T16:35:18.336  internal/poll.(*pollDesc).waitRead(...)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/internal/poll/fd_poll_runtime.go:92
2021-04-22T16:35:18.336  internal/poll.(*FD).Read(0xc00019a180, 0xc0001e883e, 0x5c2, 0x5c2, 0x0, 0x0, 0x0)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/internal/poll/fd_unix.go:169 +0x1cf
2021-04-22T16:35:18.336  os.(*File).read(...)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/os/file_unix.go:259
2021-04-22T16:35:18.336  os.(*File).Read(0xc000198060, 0xc0001e883e, 0x5c2, 0x5c2, 0x1, 0x0, 0x0)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/os/file.go:116 +0x71
2021-04-22T16:35:18.336  bytes.(*Buffer).ReadFrom(0xc00017a3c0, 0x574d60, 0xc000198060, 0x7fcae7025028, 0xc00017a3c0, 0x1)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/bytes/buffer.go:204 +0xb4
2021-04-22T16:35:18.336  io.copyBuffer(0x574ba0, 0xc00017a3c0, 0x574d60, 0xc000198060, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/io/io.go:388 +0x2ed
2021-04-22T16:35:18.336  io.Copy(...)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/io/io.go:364
2021-04-22T16:35:18.336  os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
2021-04-22T16:35:18.336     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec/exec.go:312 +0x63
2021-04-22T16:35:18.337  os/exec.(*Cmd).Start.func1(0xc0001d8000, 0xc00018e3c0)
2021-04-22T16:35:18.337     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec/exec.go:440 +0x27
2021-04-22T16:35:18.337  created by os/exec.(*Cmd).Start
2021-04-22T16:35:18.337     /opt/hostedtoolcache/go/1.13.15/x64/src/os/exec/exec.go:439 +0x632
2021-04-22T16:35:18.337  rax    0xf7
2021-04-22T16:35:18.337  rbx    0xc00003a500
2021-04-22T16:35:18.337  rcx    0x499aaa
2021-04-22T16:35:18.337  rdx    0xc000173a98
2021-04-22T16:35:18.337  rdi    0x1
2021-04-22T16:35:18.337  rsi    0x3ca
2021-04-22T16:35:18.337  rbp    0xc000173b28
2021-04-22T16:35:18.337  rsp    0xc000173a40
2021-04-22T16:35:18.337  r8     0x0
2021-04-22T16:35:18.337  r9     0x0
2021-04-22T16:35:18.337  r10    0x1000004
2021-04-22T16:35:18.337  r11    0x202
2021-04-22T16:35:18.337  r12    0xf1
2021-04-22T16:35:18.337  r13    0x0
2021-04-22T16:35:18.337  r14    0x570ab0
2021-04-22T16:35:18.337  r15    0x0
2021-04-22T16:35:18.337  rip    0x499aa8
2021-04-22T16:35:18.337  rflags 0x202
2021-04-22T16:35:18.337  cs     0x33
2021-04-22T16:35:18.337  fs     0x0
2021-04-22T16:35:18.337  gs     0x0
2021-04-22T16:35:36.508  Error occurred while waiting for runner process to finish.
2021-04-22T16:35:36.508  Error : exit status 2
2021-04-22T16:35:36.508  Error ----------------------------------
2021-04-22T16:35:36.508  
2021-04-22T16:35:36.508  [Gauge]
2021-04-22T16:35:36.508  Failed to start gauge API: Error occurred while waiting for runner process to finish.
2021-04-22T16:35:36.508  Error : exit status 2
2021-04-22T16:35:36.508  
2021-04-22T16:35:36.508  Get Support ----------------------------
2021-04-22T16:35:36.509     Docs:          https://docs.gauge.org
2021-04-22T16:35:36.509     Bugs:          https://github.com/getgauge/gauge/issues
2021-04-22T16:35:36.509     Chat:          https://github.com/getgauge/gauge/discussions
2021-04-22T16:35:36.509  
2021-04-22T16:35:36.509  Your Environment Information -----------
2021-04-22T16:35:36.509     linux, 1.1.8, b1501f4
2021-04-22T16:35:36.509     html-report (4.0.12), java (0.7.13), screenshot (0.0.1), xml-report (0.2.3)

Does anyone has any idea about running Gauge in Kubernetes? For more details and logs look here: Discussion

Best regards

Nick-Triller commented 3 years ago

Hi,

FYI, this issue has been resolved. The problem was caused by Instana, a monitoring tool with auto-instrumentation capabilities. Instana attaches to all JVMs running on a host. The process of dynamically attaching to a JVM includes sending a SIGQUIT signal. Unfortunately, Instana detected gauge-java as a JVM process which caused the behaviour described above.

Thanks Nick

sriv commented 3 years ago

Thanks for circling back @Nick-Triller .