Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

che-theia jest test 'use default extensions' is unstable. #14276

Closed
4 of 23 tasks
AndrienkoAleksandr opened this issue Aug 19, 2019 · 4 comments
Closed
4 of 23 tasks

che-theia jest test 'use default extensions' is unstable. #14276

AndrienkoAleksandr opened this issue Aug 19, 2019 · 4 comments
Labels
area/editor/theia Issues related to the che-theia IDE of Che area/install Issues related to installation, including offline/air gap and initial setup kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@AndrienkoAleksandr
Copy link
Contributor

AndrienkoAleksandr commented Aug 19, 2019

Describe the bug

che-theia jest test 'use default extensions' is unstable. From time to time this test fail, because it downloads source code che-theia. If network is pretty slow this test fail. By default jest test has timeout 5 sec. In my case, sometimes I need patch this test manually and set up timeout 10sec to pass this test inside container build... We need take a look do we really need to clone real big project in the test...

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Use devfile https://github.com/eclipse/che-theia/blob/master/devfiles/che-theia-all.devfile.yaml
  2. Go to che-theia project and try to build it:
$ cd /projects/che-theia && yarn
  1. From time to time see error:
Error log
console.info src/logger.ts:190
@eclipse-che/theia-generator:       Creating symlink from /tmp/tmpExtensions2226131WokKRWDESZ/che-theia/source-code2 to /tmp/tmpExtensions2226131WokKRWDESZ/plugins/source-code2
@eclipse-che/theia-generator:     console.info src/logger.ts:190
@eclipse-che/theia-generator:       Skipping cloning sources for /tmp/tmpExtensions22261uA3R5hALw8om/source-code1 already provided...
@eclipse-che/theia-generator:   ● Test Extensions › use default extensions
@eclipse-che/theia-generator:     Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.
@eclipse-che/theia-generator:       201 |     });
@eclipse-che/theia-generator:       202 | 
@eclipse-che/theia-generator:     > 203 |     test('use default extensions', async () => {
@eclipse-che/theia-generator:           |     ^
@eclipse-che/theia-generator:       204 |         const initSources = new InitSources(assemblyExamplePath, packagesFolderTmp, pluginsFolderTmp, cheTheiaFolderTmp, assemblyFolderTmp, THEIA_DUMMY_VERSION);
@eclipse-che/theia-generator:       205 |         await initSources.readConfigurationAndGenerate(undefined, false);
@eclipse-che/theia-generator:       206 |         expect(fs.readdirSync(packagesFolderTmp).length).toBeGreaterThan(0);
@eclipse-che/theia-generator:       at Spec (../node_modules/jest-cli/node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
@eclipse-che/theia-generator:       at Suite.Object.<anonymous>.describe (tests/init-sources/init-sources.spec.ts:203:5)
@eclipse-che/theia-generator:       at Object.<anonymous> (tests/init-sources/init-sources.spec.ts:22:1)
@eclipse-che/theia-generator:   ● Test Extensions › use extensions and plugins
@eclipse-che/theia-generator:     Unable to execute the command git clone https://github.com/eclipse/che-theia che-theia: Error: Command failed: git clone https://github.com/eclipse/che-theia che-theia
@eclipse-che/theia-generator:     Cloning into 'che-theia'...
@eclipse-che/theia-generator:     error: could not lock config file /tmp/tmpExtensions22261hZI5WGhhJK6P/che-theia/che-theia/.git/config: No such file or directory
@eclipse-che/theia-generator:     fatal: could not set 'remote.origin.fetch' to '+refs/heads/*:refs/remotes/origin/*'
@eclipse-che/theia-generator:       at cp.exec (src/command.ts:887:32)

Expected behavior

che-theia jest tests inside container should be stable.

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Installation method

  • chectl
  • che-operator
  • minishift-addon
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: please specify
@AndrienkoAleksandr AndrienkoAleksandr added the kind/bug Outline of a bug - must adhere to the bug report template. label Aug 19, 2019
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 19, 2019
@rhopp rhopp added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Aug 19, 2019
@rhopp rhopp added this to the 7.x milestone Aug 19, 2019
@rhopp rhopp added the area/editor/theia Issues related to the che-theia IDE of Che label Aug 19, 2019
@l0rd l0rd added the team/ide2 label Aug 29, 2019
@nickboldt
Copy link
Contributor

nickboldt commented Sep 28, 2019

I'm seeing this too...

Error log
      Skipping cloning sources for /tmp/tmpExtensions31650pLnGeOWvatBd/source-code1 already provided...

  ● Test Extensions › use default extensions

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      201 |     });
      202 | 
    > 203 |     test('use default extensions', async () => {
          |     ^
      204 |         const initSources = new InitSources(assemblyExamplePath, packagesFolderTmp, pluginsFolderTmp, cheTheiaFolderTmp, assemblyFolderTmp, THEIA_DUMMY_VERSION);
      205 |         await initSources.readConfigurationAndGenerate(undefined, false);
      206 |         expect(fs.readdirSync(packagesFolderTmp).length).toBeGreaterThan(0);

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.Object.<anonymous>.describe (tests/init-sources/init-sources.spec.ts:203:5)
      at Object.<anonymous> (tests/init-sources/init-sources.spec.ts:22:1)

  ● Test Extensions › use extensions and plugins

    Unable to execute the command git clone https://github.com/eclipse/che-theia che-theia: Error: Command failed: git clone https://github.com/eclipse/che-theia che-theia
    Cloning into 'che-theia'...
    fatal: unable to open /tmp/tmpExtensions31650SWBn1kb0Zug1/che-theia/che-theia/.git/objects/pack/tmp_pack_zwjGId: No such file or directory
    fatal: index-pack failed



      at cp.exec (src/command.ts:887:32)

All I have to do is rebuild the che-theia generator - see simplified steps below.

Only happens about 50% of the time though, which is super annoying when building in CI. :(

Steps to reproduce:

base_dir=/tmp
LOCAL_ASSEMBLY_DIR="${base_dir}"/generator
mkdir -p ${LOCAL_ASSEMBLY_DIR}

CHE_THEIA_GENERATOR_PACKAGE_NAME=eclipse-che-theia-generator.tgz
CHE_THEIA_GENERATOR_PACKAGE="${LOCAL_ASSEMBLY_DIR}/${CHE_THEIA_GENERATOR_PACKAGE_NAME}"

CHE_THEIA_GIT_BRANCH_NAME=7.2.0
CHE_THEIA_GITHUB_REPO=eclipse/che-theia
if [[ -d theia-source-code/che-theia ]]; then rm -fr theia-source-code/che-theia; fi; mkdir -p theia-source-code
echo "Check out https://github.com/${CHE_THEIA_GITHUB_REPO} from branch ${CHE_THEIA_GIT_BRANCH_NAME} to ./theia-source-code/che-theia ..."
git clone -q --branch ${CHE_THEIA_GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/${CHE_THEIA_GITHUB_REPO} theia-source-code/che-theia
mv theia-source-code/che-theia/generator/* ${LOCAL_ASSEMBLY_DIR}/ && \
rm -fr theia-source-code/che-theia

cd "${LOCAL_ASSEMBLY_DIR}" && echo "Build Che Theia generator in ${LOCAL_ASSEMBLY_DIR} ..."

yarn && yarn pack --filename $CHE_THEIA_GENERATOR_PACKAGE_NAME

@nickboldt nickboldt added team/productization area/install Issues related to installation, including offline/air gap and initial setup labels Sep 28, 2019
@nickboldt
Copy link
Contributor

nickboldt commented Sep 28, 2019

Workaround found - tweak your package.json on line 52 file like this to disable these two failing tests (plus all the other ones in that folder):

-    "test": "jest"
+    "test": "jest --testPathIgnorePatterns=tests/init-sources",

@nickboldt
Copy link
Contributor

Or could we just increase the timeout from 5s to 15s ??

@AndrienkoAleksandr
Copy link
Contributor Author

Or could we just increase the timeout from 5s to 15s ??

@evidolob what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che area/install Issues related to installation, including offline/air gap and initial setup kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

6 participants