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

Unit Test discovery crashes when "undefined" and can no longer run #134

Closed
DonJayamanne opened this issue Nov 13, 2017 · 8 comments
Closed
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@DonJayamanne
Copy link

From @mcesnik on June 27, 2017 17:10

Environment data

VS Code version: 1.13.1
Python Extension version: 0.6.5
Python Version: 2.7.11
OS and version: Windows 10 + Mac OSX 11

Actual behavior

When saving code, unit test discovery occasionally hangs on an error "undefined" and cannot recover without restarting VS code. This does not happen but happens frequently enough to warrant a bug report.

Expected behavior

Discovery should not fail or should recover when the error happens.

Steps to reproduce:

  • Create a shortcut to run unit tests
  • Code a unit test, hit save
  • Before discovery completes try to run unit tests and see output console window shows "undefined"
  • Running unit tests again or discovery will no longer work
  • Restart IDE and start over.

Settings

Your launch.json (if dealing with debugger issues):
{
"version": "0.2.0",
"configurations": [

    {
        "name": "Python",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "pythonPath": "$python.pythonPath}",
        "program": "${file}",
        "cwd": "${workspaceRoot}",
        "env": {},
        "envFile": "${workspaceRoot}/.env",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOutput"
        ]
    }
]

}

Your settings.json:
{
"files.exclude": {
"/*.pyc": true,
"
/pycache": true
},

"python.unitTest.unittestArgs": [
    "-v",
    "-f",
    "-s",
    "tests",
    "-p",
    "test_collector.py"
],
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.maxNumberOfProblems": 50,
"python.linting.pylintArgs": ["--rcfile=./.vscode/pylint.rc"],
"python.unitTest.unittestEnabled": true,
"python.formatting.formatOnSave": true

}

Logs

Output from Python output panel

Output from Console window (Help->Developer Tools menu)

Copied from original issue: DonJayamanne/pythonVSCode#1054

@DonJayamanne
Copy link
Author

Please re-create the launch.json file and try again.

@DonJayamanne
Copy link
Author

From @mcesnik on June 29, 2017 18:47

@DonJayamanne, sorry, is that done using the "Add Configuration" button in VS code? If so, cool, did that and will see how it goes.

@DonJayamanne
Copy link
Author

From @mcesnik on June 30, 2017 17:45

This didn't seem to have any affect. I still get unit tests hanging when I save and try to run them too quickly.

@DonJayamanne
Copy link
Author

Please could you provide a sample project that I could use to replicate this issue (or a repo), please do provide the instructions and necessary settings.json and launch.json files.

@DonJayamanne
Copy link
Author

From @mcesnik on July 4, 2017 14:21

You can try this zip file: https://drive.google.com/open?id=0B49rqCI3E_Z2c2NnSXB1czdsTTQ

It's my first py project so go easy on me :) The .vscode folder has both settings.json and launch.json.

The steps to recreate don't always recreate the issue. I find if you edit a file hit save and run unit tests quickly enough the error happens (although I don't see any info anywhere after that). Once the error happens unit tests will "run" but never actually execute. I have to restart VS code.

@DonJayamanne
Copy link
Author

@mcesnik , apologies for the delay, will look into this soon.

@brettcannon brettcannon added awaiting 1-verification area-testing bug Issue identified by VS Code Team member as probable bug labels Nov 14, 2017
@DonJayamanne
Copy link
Author

@mcesnik I believe this has been fixed. Please could you test this out on the latest version of the Python extension.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed awaiting 1-verification labels Dec 20, 2017
@MikhailArkhipov
Copy link

Feel free to reopen if this issue is still a problem.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants