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

Update CI to use Node 12 #2538

Merged
merged 4 commits into from
Mar 3, 2020
Merged

Update CI to use Node 12 #2538

merged 4 commits into from
Mar 3, 2020

Conversation

taneliang
Copy link
Member

@taneliang taneliang commented Mar 3, 2020

Our Docker setup already uses Node 12 LTS. Once this PR is merged, I'll upgrade Node on the 1. server from Node 10 to Node 12.

Our Docker setup already uses Node 12.
@codecov
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #2538 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2538   +/-   ##
=======================================
  Coverage   45.52%   45.52%           
=======================================
  Files         244      244           
  Lines        5162     5162           
  Branches     1181     1181           
=======================================
  Hits         2350     2350           
  Misses       2812     2812           

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 6319e46...42492f2. Read the comment docs.

expect(mockedAxios.post).toBeCalledTimes(4);
expect(api.queue.getPendingLength()).toEqual(0);
Copy link
Member Author

Choose a reason for hiding this comment

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

@ZhangYiJiang any reason this should be 0? getPendingLength returns 2 in Node 12 but returns 0 in Node 10.

I think a pending length of 2 may make sense since p3 and p4 may have already been dequeued (and thus started) after the values are resolved. The relevant library code is at https://github.com/promise-queue/promise-queue/blob/fd3ea37d56def993da2b34dc1a87f66e92b9e808/lib/index.js#L153-L160.

Either way, I think the remaining 2 checks on lines 121-122 should be enough to ensure that all the requests fire at some point. Lines 113-115 now ensure that we hit the concurrency limit without exceeding it.

Copy link
Member

Choose a reason for hiding this comment

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

I think you're right, I might have mistaken getPendingLength for the number of buffered tasks

Copy link
Member Author

Choose a reason for hiding this comment

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

Understandable, both getPendingLength and getQueueLength have extremely confusing names and comments. I had to read the source to figure out what they actually referred to

@nusmods-deploy-bot
Copy link

@ZhangYiJiang ZhangYiJiang merged commit fa3cf58 into master Mar 3, 2020
@ZhangYiJiang ZhangYiJiang deleted the node-12 branch March 3, 2020 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants