Skip to content

test: run tests on multiple node versions - #22420

Merged
dgp1130 merged 2 commits into
angular:mainfrom
aspect-build:multi-node
Aug 3, 2022
Merged

test: run tests on multiple node versions#22420
dgp1130 merged 2 commits into
angular:mainfrom
aspect-build:multi-node

Conversation

@dymart

@dymart dymart commented Dec 22, 2021

Copy link
Copy Markdown

No description provided.

@dymart dymart changed the title test(@angular/cli,@angular/pwa,@angular-devkit/architect,@angular-dev… test: add multiple node versions for each test Dec 23, 2021
@jbedard jbedard changed the title test: add multiple node versions for each test test: run tests on multiple node versions Apr 29, 2022
Comment thread packages/angular_devkit/build_angular/BUILD.bazel Outdated
@jbedard
jbedard requested a review from josephperrott April 29, 2022 17:39
@jbedard
jbedard requested review from alan-agius4 and kormide May 10, 2022 20:42
@jbedard

jbedard commented May 10, 2022

Copy link
Copy Markdown
Contributor

Note the current test failure seems to be because the median test run is faster then expected? See poll_spec.ts

@alan-agius4

Copy link
Copy Markdown
Collaborator

Is this something that you still want to land?

@jbedard

jbedard commented Jun 8, 2022

Copy link
Copy Markdown
Contributor

Yeah we'd still like to do this one. I had I think all but one test green but have been working on #23074 instead lately.

@jbedard
jbedard requested a review from clydin June 24, 2022 20:38
@jbedard

jbedard commented Jun 24, 2022

Copy link
Copy Markdown
Contributor

@alan-agius4 there is one TODO left here but I think this is worth landing as-is for now. WDYT?

Comment on lines +401 to +405
# TODO: test on multiple node versions
# Some tests use specific ports and can not be run concurrently
# Some tests fail for unknown reasons when run on multiple platforms

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These tests are probably the most important that should be ran on multiple platforms.

Do you have examples of the failures?

Probably we can investigate this in the near future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One reason migth be the devservers all using port 4200 which we should be able to configure to be random. I'll look into that more if this test is important.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That shouldn’t be hard to do as the CLI does support port 0.

I can take a look at these maybe in a week.

@alan-agius4 alan-agius4 Jun 27, 2022

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am happy to get the setup in before that. Unless @clydin has any reservations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm going to work on this and push to this PR but you can merge the first commit now if you'd like

Comment thread packages/angular_devkit/build_angular/BUILD.bazel Outdated
@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: minor This PR is targeted for the next minor release labels Jun 29, 2022
Comment thread packages/angular_devkit/build_angular/src/builders/dev-server/index.ts Outdated
Comment thread packages/angular_devkit/build_angular/src/builders/dev-server/index.ts Outdated
Comment thread .bazelrc Outdated
# Architect resolves output files from data files, and this isn't possible without runfile support.
test --enable_runfiles

build --experimental_remote_merkle_tree_cache No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This caches the analysis of bazel actions better. Because we have exports_directories_only = False (which ts_library requires?) every single file in the node_moduels gets traversed instead of only the package folders which creates a giant tree. This is also the reason for increasing the circleci resource_class.

@jbedard

jbedard commented Jun 29, 2022

Copy link
Copy Markdown
Contributor

The flakyness of these tests is very odd, and I think a lot of it has nothing to do with this change. Things like @angular-devkit/core not being found errors 🤔

@alan-agius4

Copy link
Copy Markdown
Collaborator

The flakyness of these tests is very odd, and I think a lot of it has nothing to do with this change. Things like @angular-devkit/core not being found errors 🤔

Strange as I haven’t seen any similar flakes on the main branch recently.

Comment thread tools/defaults.bzl
exclude_prefixes = [
"packages", # Exclude compiled outputs of dependent packages
],
allow_overwrites = True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needed to be added due to an update to aspect_bazel_lib that someone else must have done. I don't fully understand why the build didn't fail until this PR though?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've reverted this for now to make this PR the absolute minimum number of changes.

@jbedard

jbedard commented Jul 13, 2022

Copy link
Copy Markdown
Contributor

@alan-agius4 we'd like to merge this as-is without actually enabling the multiple versions and just setting up the toolchains + BUILDs.

It seems like these tests are very flaky and doubling the number of them makes it fail what seems like 100% of the time. Specifically the packages/angular_devkit/build_angular tests which are put under the LARGE_SPECS variable name, the rest actually seem ok if we want to enable the rest (14/15 of them). This test even fails sometimes with no changes at all (like the PR currently is - only adding the toolchains config).

@jbedard
jbedard requested a review from alan-agius4 July 18, 2022 17:15
Comment thread tools/toolchain_info.bzl Outdated
@alan-agius4

Copy link
Copy Markdown
Collaborator

@jbedard can you please rebase?
As I am unable to do that for you as edits by maintainers is not allowed for this PR.

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Aug 2, 2022
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release and removed target: minor This PR is targeted for the next minor release labels Aug 2, 2022
@dgp1130
dgp1130 merged commit db5c1fc into angular:main Aug 3, 2022
@alan-agius4

Copy link
Copy Markdown
Collaborator

Since this change went in, test flakiness have increased.

One of the main errors is

java.lang.OutOfMemoryError: Java heap space

@jbedard

jbedard commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

@alan-agius4 can we increase the circleci resource_class?

@jbedard

jbedard commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

Or it might actually be better as a separate circleci step per node version? Then we're doubling the number of steps instead of number of concurrent tests. That is probably required for the e2e tests so might be a good prefactor that we can do first...

@alan-agius4

Copy link
Copy Markdown
Collaborator

We have discussed this during our meeting today and for the time being until we find out the cause of the increase in memory usage. We will like to disable testing on multiple node versions.

The main reasons for this is that we don’t have many targets which justice usage of 14Gb memory considering we also use RBE. An increase the resource class would also double the credit usage if we go with 2 X-large.

I am curious to know which additional “steps” you thing we can share.

@jbedard

jbedard commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

The increase in memory usage is from doubling the number of tests running concurrently in the test circleci job.

Today we're running the different node versions concurrently in one circleci step within the test job. We could do the same as the e2e-tests and use matrix params to create a separate job per node version, or create a separate step per node version within the test job so they run sequentially within a single job.

@alan-agius4

Copy link
Copy Markdown
Collaborator

The increase in memory usage is from doubling the number of tests running concurrently in the test circleci job.

But we are using RBE so they are not actually run on circle. Also I wouldn’t expect 14GB of memory to be used just to run these tests considering we don’t have many targets.

@jbedard

jbedard commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

But we are using RBE so they are not actually run on circle.

Right... you're sure bazel reporting those means it is the circleci machine and not the remote one?

@jbedard

jbedard commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

But we are using RBE so they are not actually run on circle.

Looking at the bazelrc... isn't that only configuring bazel build (not test) to run remotely?

@alan-agius4

alan-agius4 commented Aug 8, 2022

Copy link
Copy Markdown
Collaborator

@jbedard

jbedard commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

If it is running remotely why would browser-tools/install-chrome be required? Is there any way to verify it's actually running remote? I'm not too familiar with circleci or remote exec...

@alan-agius4

alan-agius4 commented Aug 9, 2022

Copy link
Copy Markdown
Collaborator

It does appear that there are some tests that run locally.

INFO: 679 processes: 215 remote cache hit, 288 internal, 40 local, 4 processwrapper-sandbox, 85 remote, 47 worker.

@jbedard

jbedard commented Aug 9, 2022

Copy link
Copy Markdown
Contributor

Right, there are a few tagged as no-remote I think due to protractor/webdriver issues:

# NB: does not run on rbe because webdriver manager uses an absolute path to chromedriver
"tags": ["no-remote-exec"],
(and another one down a bit)

@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants