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

Karma server not stopped when vscode is closed #25

Closed
doktordirk opened this issue Mar 7, 2022 · 6 comments
Closed

Karma server not stopped when vscode is closed #25

doktordirk opened this issue Mar 7, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@doktordirk
Copy link

Describe the Bug

  • Karma server not stopped when vscode is closed

Steps to Reproduce the Behavior

  1. Open vscode and wait till extensions is initialized
  2. Close vscode
  3. See orphaned node task in eg system monitor

Describe the Expected Behavior

  • Karma server stopped when vscode is closed

Provide Debug Logs

Screenshots

image

Please Provide the Following Information

  • OS: Ubuntu 20.04
  • Environment: local
  • Node Version: v16.14.0
  • VSCode Version: 1.65.0
  • Karma Version: ^6.3.14
  • Frameworks: jasmine ^2.0.1

Additional Context

  • Add any other context about the problem here.
@doktordirk doktordirk added the bug Something isn't working label Mar 7, 2022
@lucono
Copy link
Owner

lucono commented Mar 11, 2022

@doktordirk if you run the command ps -fe, what's the full process command printed for the unterminated node processes?

@doktordirk
Copy link
Author

doktordirk commented Mar 11, 2022

@lucono nothing exiting i'd guess

dirk       12592    2625  9 09:25 ?        00:01:03 /usr/bin/node /home/dirk/repo/webapp/node_modules/karma/bin/karma start /home/dirk/.vscode/extensions/lucono.karma-test-explorer-0.5.0/dist/karma.conf --no-single-run
dirk       13623    2625  5 09:28 ?        00:00:25 /usr/bin/node /home/dirk/repo/webapp/node_modules/karma/bin/karma start /home/dirk/.vscode/extensions/lucono.karma-test-explorer-0.5.0/dist/karma.conf --no-single-run
dirk       14173    2625  5 09:29 ?        00:00:22 /usr/bin/node /home/dirk/repo/webapp/node_modules/karma/bin/karma start /home/dirk/.vscode/extensions/lucono.karma-test-explorer-0.5.0/dist/karma.conf --no-single-run

karma.conf.js

// Karma configuration

const path = require('path');

const buildDir = process.env.BUILD_DIR
  ? process.env.BUILD_DIR
  : '../build/tomcat/webapps/ROOT';
const srcDir = 'src/main/webapp/static-content';
const options = process.argv.filter((option) => option.startsWith('--'));

module.exports = (config) => {
  config.set({
    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['webpack', 'jasmine'],

    // list of files / patterns to load in the browser
    files: [
      {
        pattern: `${srcDir}/icon/**/*.*`,
        watched: true,
        included: false,
        served: true,
      },
      {
        pattern: `${srcDir}/img/**/*.*`,
        watched: true,
        included: false,
        served: true,
      },
      {
        pattern: `${srcDir}/font/**/*.*`,
        watched: true,
        included: false,
        served: true,
      },
      `${srcDir}/js/jquery/jquery-1.8.2.min.js`,
      {
        pattern: `${buildDir}/static-content/**/*.*`,
        watched: false,
        included: false,
        served: true,
      },
      { pattern: `${srcDir}/aurelia/aurelia-tests.js`, watched: false },
    ],

    /*
     * preprocess matching files before serving them to the browser
     * available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
     */
    preprocessors: {
      [`${srcDir}/aurelia/aurelia-tests.js`]: ['webpack'],
    },

    webpack: require('./webpack.config')({ tests: true }),

    proxies: {
      '/static/icon/': `/base/${srcDir}/icon/`,
      '/static/icon/svg/': `/base/${srcDir}/icon/svg/`,
      '/static/img/': `/base/${srcDir}/img/`,
      '/static/font/': `/base/${srcDir}/font/`,
      '/static/webpack/': `${buildDir}/static-content/`,
    },

    // list of files to exclude
    exclude: [],

    /*
     * test results reporter to use
     *
     * possible values: 'dots', 'progress'
     * available reporters: https://npmjs.org/browse/keyword/karma-reporter
     */
    reporters: ['mocha', 'coverage'],

    coverageReporter: {
      reporters: [
        { type: 'html' },
        { type: 'lcovonly' },
        { type: 'text-summary' },
      ],
      dir: `${buildDir}/karma-results`,
      subdir: '.',
    },

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    customLaunchers: {
      ChromeDebugging: {
        base: 'Chrome',
        flags: ['--remote-debugging-port=9333', '--disable-gpu', ...options],
      },
    },

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['ChromeDebugging'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false,

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity,
  });
};

no vscode settings to (karma-)test-explorer had been added

@lucono
Copy link
Owner

lucono commented Mar 14, 2022

@doktordirk I'm not able to reproduce this (on ubuntu 18.04). The Karma Test Explorer and Karma Server output channel debug logs may have some information on why it might be failing to stop. If you'd like to look into it locally, the point where the server is stopped is here, which leads here further down the line, with the Karma server then killed here.

lucono added a commit that referenced this issue Mar 20, 2022
- Fix issue Karma server not stopped when vscode is closed #25
@lucono
Copy link
Owner

lucono commented Mar 20, 2022

@doktordirk I was later able to reproduce this. Try out the visx from the beta branch to confirm if it resolves the issue.

@doktordirk
Copy link
Author

tx. Issue solved!

lucono added a commit that referenced this issue Apr 7, 2022
Resolves issues #22, #25, and adds feature #27 for v0.6.0
@lucono
Copy link
Owner

lucono commented Apr 7, 2022

Released in v0.6.0

@lucono lucono closed this as completed Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants