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

feat: use common TSConfig for clients #3145

Closed
wants to merge 16 commits into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Jan 5, 2022

Issue

Refs: #1307
Replaces: #3132

Description

Uses common TSConfig for all generated clients

Testing

CI


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #3145 (e707807) into main (e6ff930) will decrease coverage by 75.19%.
The diff coverage is n/a.

❗ Current head e707807 differs from pull request most recent head e08a528. Consider uploading reports for the commit e08a528 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main   #3145       +/-   ##
==========================================
- Coverage   75.19%       0   -75.20%     
==========================================
  Files         474       0      -474     
  Lines       20724       0    -20724     
  Branches     4756       0     -4756     
==========================================
- Hits        15584       0    -15584     
+ Misses       5140       0     -5140     
Impacted Files Coverage Δ
packages/body-checksum-node/src/index.ts
...nds/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts
...oltests-query/src/commands/XmlNamespacesCommand.ts
packages/service-error-classification/src/index.ts
...es/config-resolver/src/regionInfo/getRegionInfo.ts
.../aws-protocoltests-ec2/src/runtimeConfig.shared.ts
packages/signature-v4-crt/src/suite.fixture.ts
...protocoltests-restxml/src/protocols/Aws_restXml.ts
...e-signing/src/utils/getUpdatedSystemClockOffset.ts
...s-ec2/src/commands/HostWithPathOperationCommand.ts
... and 464 more

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 e6ff930...e08a528. Read the comment docs.

@trivikr
Copy link
Member Author

trivikr commented Jan 5, 2022

Jest fails again with Out of Memory error 😕

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa1a640 node::Abort() [/usr/local/bin/node]
 2: 0xa1aa4c node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 3: 0xb9a68e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0xb9aa09 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0xd57c85  [/usr/local/bin/node]
 6: 0xd58316 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
 7: 0xd64bd5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
 8: 0xd65a85 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 9: 0xd6712f v8::internal::Heap::HandleGCRequest() [/usr/local/bin/node]
10: 0xd15b95 v8::internal::StackGuard::HandleInterrupts() [/usr/local/bin/node]
11: 0x1071236 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x140dcd9  [/usr/local/bin/node]

<--- Last few GCs --->

[29055:0x43d4f00]   120342 ms: Scavenge 2042.2 (2048.0) -> 2041.8 (2048.3) MB, 53.0 / 0.0 ms  (average mu = 0.308, current mu = 0.336) allocation failure 
[29055:0x43d4f00]   120530 ms: Scavenge 2042.5 (2048.3) -> 2042.1 (2048.5) MB, 64.0 / 0.0 ms  (average mu = 0.308, current mu = 0.336) allocation failure 
[29055:0x43d4f00]   120722 ms: Scavenge 2042.7 (2048.5) -> 2042.2 (2048.8) MB, 102.1 / 0.0 ms  (average mu = 0.308, current mu = 0.336) allocation failure 


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x140dcd9]
Security context: 0x072a87d808d1 <JSObject>
    1: scanJsDocToken [0x3c6b20a962d1] [/codebuild/output/src279475912/src/github.com/aws/aws-sdk-js-v3/node_modules/typescript/lib/typescript.js:~11580] [pc=0x3feb5a134923](this=0x3c6b20a902f9 <Object map = 0x319cae06e019>)
    2: /* anonymous */(aka /* anonymous */) [0x178f834c5979] [/codebuild/output/src279475912/src/github.com/aws/aws-sdk-js-v3/node_modules/t...

Link: sdk-staging-test:21dcebac-cb7b-4e63-a93f-7f8b85d7fa38
Prior findings #2864 (comment)

@trivikr
Copy link
Member Author

trivikr commented Jan 5, 2022

OutOfMemory error is thrown even if jest unit tests are run sequentially

$ node --expose-gc ./node_modules/.bin/jest --runInBand

 RUNS  private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts

<--- Last few GCs --->

[18286:0x681a320]    61882 ms: Mark-sweep 4049.1 (4139.7) -> 4037.9 (4142.0) MB, 4962.3 / 0.0 ms  (average mu = 0.245, current mu = 0.013) allocation failure scavenge might not succeed
[18286:0x681a320]    66635 ms: Mark-sweep 4054.1 (4142.2) -> 4041.1 (4145.2) MB, 4702.1 / 0.0 ms  (average mu = 0.137, current mu = 0.011) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb02ec0 node::Abort() [node]
 2: 0xa181fb node::FatalError(char const*, char const*) [node]
 3: 0xced88e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xcedc07 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xea5ea5  [node]
 6: 0xeb557d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 7: 0xeb827e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 8: 0xe796aa v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
 9: 0x11f2e86 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
10: 0x15e7879  [node]
zsh: abort      node --expose-gc ./node_modules/.bin/jest --runInBand

@trivikr
Copy link
Member Author

trivikr commented Jan 5, 2022

Setting up isolatedModules to true also doesn't help.

Refs: kulshekhar/ts-jest#1967 (comment)

foreach parentDir ("clients" "private")
  for dir in ./$parentDir/*; do (cd "$dir" && sed -i 's/tsconfig.json/tsconfig.cjs.json/g' ./package.json); done
  for dir in ./$parentDir/*; do (cd "$dir" && mv tsconfig.json tsconfig.cjs.json); done
end
foreach parentDir ("clients" "private")
  foreach tsConfigType ("cjs" "es" "types")
    for dir in ./$parentDir/*; do (
      cd "$dir"
      cp ../../clients/client-accessanalyzer/tsconfig.$tsConfigType.json tsconfig.$tsConfigType.json
    ); done
  end
end
@trivikr trivikr force-pushed the root-tsconfig-final branch from b0c3516 to e08a528 Compare January 5, 2022 23:34
@trivikr
Copy link
Member Author

trivikr commented Jan 5, 2022

Attempting to use lerna run test to avoid jest Out of memory error in #3148

@trivikr
Copy link
Member Author

trivikr commented Jan 6, 2022

Testing future attempts in #3149

@trivikr trivikr closed this Jan 6, 2022
@trivikr trivikr deleted the root-tsconfig-final branch January 6, 2022 01:27
@trivikr
Copy link
Member Author

trivikr commented Jan 6, 2022

Blog post for future reference to debug jest OutOfMemory error, if this issue is revisited
https://making.close.com/posts/finding-the-cause-of-a-memory-leak-in-jest

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants