Skip to content

Fix multiroot flaky CI tests #11544

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

Merged
merged 2 commits into from
May 4, 2020
Merged

Fix multiroot flaky CI tests #11544

merged 2 commits into from
May 4, 2020

Conversation

karrtikr
Copy link

@karrtikr karrtikr commented May 1, 2020

For #11477

@karrtikr karrtikr added the no-changelog No news entry required label May 1, 2020
@codecov-io
Copy link

codecov-io commented May 1, 2020

Codecov Report

Merging #11544 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11544      +/-   ##
==========================================
- Coverage   60.46%   60.43%   -0.03%     
==========================================
  Files         618      618              
  Lines       33776    33774       -2     
  Branches     4764     4763       -1     
==========================================
- Hits        20421    20413       -8     
- Misses      12347    12351       +4     
- Partials     1008     1010       +2     
Impacted Files Coverage Δ
src/datascience-ui/react-common/arePathsSame.ts 75.00% <0.00%> (-12.50%) ⬇️
src/client/common/utils/platform.ts 64.70% <0.00%> (-11.77%) ⬇️
src/client/linters/pydocstyle.ts 86.66% <0.00%> (-2.23%) ⬇️
src/client/datascience/debugLocationTracker.ts 76.56% <0.00%> (-1.57%) ⬇️
src/client/common/process/proc.ts 14.49% <0.00%> (-0.73%) ⬇️
...client/datascience/kernel-launcher/kernelFinder.ts 63.96% <0.00%> (-0.64%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 262c14f...e715f8d. Read the comment docs.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 2, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.4% 0.4% Duplication

@karrtikr karrtikr marked this pull request as ready for review May 2, 2020 15:59
@@ -20,7 +20,7 @@ export const multirootPath = path.join(__dirname, '..', '..', 'src', 'testMultiR
const workspace3Uri = vscode.Uri.file(path.join(multirootPath, 'workspace3'));

//First thing to be executed.
process.env['VSC_PYTHON_CI_TEST'] = '1';
process.env.VSC_PYTHON_CI_TEST = '1';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is magic.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this make any difference? It's a noop

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't change anything. It's the other line I added. The variable was not set earlier when running multiroot tests.

Copy link

@kimadeline kimadeline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Karthik said, this is magic ✨ you explain how adding process.env.VSC_PYTHON_CI_TEST fixes the flakiness?

@karrtikr
Copy link
Author

karrtikr commented May 4, 2020

@kimadeline @karthiknadig If process.env.VSC_PYTHON_CI_TEST is not set, api object is returned with the serviceContainer as undefined, which is why using serviceContainer.get failed in tests.

Here's the implementation

    if (process.env.VSC_PYTHON_CI_TEST === '1' || isUnitTestExecution()) {
        // tslint:disable:no-any
        (api as any).serviceContainer = serviceContainer;
        (api as any).serviceManager = serviceManager;
        // tslint:enable:no-any
    }

So I explicitly set it before launching multiroot tests, it was already being done for single workspace and other types of tests.

@karrtikr karrtikr merged commit c440a23 into microsoft:master May 4, 2020
@karrtikr karrtikr deleted the fixflaky branch May 4, 2020 15:40
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants