eclipse-archived / codewind

The official repository of the Eclipse Codewind project
https://codewind.dev
Eclipse Public License 2.0
114 stars 44 forks source link

Turbine Functional - Add Logs for debugging #2271

Open maysunfaisal opened 4 years ago

maysunfaisal commented 4 years ago

Codewind version: OS:

Che version: IDE extension version: IDE version: Kubernetes cluster:

Description: There are times when Turbine Functional tests are flaky or a test that fails one off.

This has been happening with enough frequency where a test has failed and classified as "one off.

For example, a create test for microprofile passed acc to Codewind logs but test determines that it failed:

[19/02/20 03:36:16 mpA1] [INFO] Emitting event 
 message: projectStatusChanged
 data: {
  "projectID": "7e9bdf50-49ee-11ea-b35b-4900f32fe436",
  "appStatus": "started",
  "detailedAppStatus": {
    "severity": "INFO",
    "message": "",
    "notify": false,
    "notificationID": ""
  }
}
[19/02/20 03:36:18 Turbine] [DEBUG] Running Builds queue: ["default-liberty-1582082210830"]

...

[19/02/20 03:38:03 Turbine] [DEBUG] Builds in progress: 1
[19/02/20 03:38:05 Turbine] [TRACE] Key translated. Returning message: Failed to get application status: connect ECONNREFUSED 192.168.96.9:9080
      1) create project

Or when we have to manually set the build status so that the project is removed from the build queue:

[19/02/20 03:38:05 Turbine] [TRACE] Key translated. Returning message: Failed to get application status: connect ECONNREFUSED 192.168.96.9:9080
      1) create project
[19/02/20 03:38:09 Turbine] [DEBUG] Running Builds queue: ["default-liberty-1582082210830"]
[19/02/20 03:38:09 Turbine] [DEBUG] Builds in progress: 1
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Validating project using operationId: 8fc24b2c0f71d4827cbef42a7657f5cb
[19/02/20 03:38:09 Turbine] [TRACE] {"projectType":"liberty","location":"/codewind-workspace/turbinetest-default-liberty","projectID":"default-liberty-1582082210830"}
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Checking for required files
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Checking for required file /Dockerfile | /Dockerfile-lang
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Build state changed for project: default-liberty-1582082210830 from: inProgress, to: success
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Emitting event 
 message: projectStatusChanged
 data: {
  "projectID": "default-liberty-1582082210830",
  "buildStatus": "success",
  "lastbuild": 1582083489512
}
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Kicking off validation for project: default-liberty-1582082210830
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Checking for required file /Dockerfile-build
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Checking for required file /pom.xml
[19/02/20 03:38:09 turbinetest-default-liberty] [INFO] Checking for required file /src/main/liberty/config/server.xml
[19/02/20 03:38:13 turbinetest-default-liberty] [INFO] Sending validation result
[19/02/20 03:38:13 turbinetest-default-liberty] [INFO] Emitting event 
 message: projectValidated
 data: {
  "operationId": "8fc24b2c0f71d4827cbef42a7657f5cb",
  "projectType": "liberty",
  "location": "/codewind-workspace/turbinetest-default-liberty",
  "projectID": "default-liberty-1582082210830",
  "status": "success",
  "results": [],
  "operation": {
    "operationId": "8fc24b2c0f71d4827cbef42a7657f5cb",
    "type": "validate",
    "projectInfo": {
      "projectType": "liberty",
      "location": "/codewind-workspace/turbinetest-default-liberty",
      "projectID": "default-liberty-1582082210830"
    }
  }
}
[19/02/20 03:38:14 turbinetest-default-liberty] [INFO] Build completed for default-liberty-1582082210830
[19/02/20 03:38:15 Turbine] [TRACE] Key translated. Returning message: Failed to get application status: connect ECONNREFUSED 192.168.96.9:9080
      2) "after all" hook: remove build from running queue for "create project"

  Suite duration: 1213.086 s, Tests: 4

projectStatusChanged has buildStatus as success, but tests cant determine and fails the case.

So we need to add logs around all such cases, so we can debug and determine, why it is failing and if the function is returning something else that the test fails it

/area iterative-dev /kind test

ssh24 commented 4 years ago

We have the ability to add "test" specific logs now btw.

If you do plan on adding logs you can simply leverage the functionality https://github.com/eclipse/codewind/blob/98245ba999bfd2670a99c1b7451b144cc5f2d0fc/src/pfe/file-watcher/server/test/functional-test/suites/generic/tests/locale.ts#L43