GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: use heapdump test for SecureContext memory tracking · nodejs/node@ab6febe

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • cctest
      • test_node_crypto.cc
    • pummel
      • test-heapdump-secure-context.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/cctest/test_node_crypto.cc‎

Copy file name to clipboardExpand all lines: test/cctest/test_node_crypto.cc
-27Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -87,33 +87,6 @@ TEST(NodeCrypto, NewRootCertStore) {
8787
X509_STORE_free(store);
8888
}
8989

90-
/*
91-
* This test verifies that OpenSSL memory tracking constants are properly
92-
* defined.
93-
*/
94-
TEST(NodeCrypto, MemoryTrackingConstants) {
95-
// Verify that our memory tracking constants are defined and reasonable
96-
EXPECT_GT(node::crypto::kSizeOf_SSL_CTX, static_cast<size_t>(0))
97-
<< "SSL_CTX size constant should be positive";
98-
EXPECT_GT(node::crypto::kSizeOf_X509, static_cast<size_t>(0))
99-
<< "X509 size constant should be positive";
100-
EXPECT_GT(node::crypto::kSizeOf_EVP_MD_CTX, static_cast<size_t>(0))
101-
<< "EVP_MD_CTX size constant should be positive";
102-
103-
// Verify reasonable size ranges (basic sanity check)
104-
EXPECT_LT(node::crypto::kSizeOf_SSL_CTX, static_cast<size_t>(10000))
105-
<< "SSL_CTX size should be reasonable";
106-
EXPECT_LT(node::crypto::kSizeOf_X509, static_cast<size_t>(10000))
107-
<< "X509 size should be reasonable";
108-
EXPECT_LT(node::crypto::kSizeOf_EVP_MD_CTX, static_cast<size_t>(1000))
109-
<< "EVP_MD_CTX size should be reasonable";
110-
111-
// Specific values we expect based on our implementation
112-
EXPECT_EQ(node::crypto::kSizeOf_SSL_CTX, static_cast<size_t>(240));
113-
EXPECT_EQ(node::crypto::kSizeOf_X509, static_cast<size_t>(128));
114-
EXPECT_EQ(node::crypto::kSizeOf_EVP_MD_CTX, static_cast<size_t>(48));
115-
}
116-
11790
TEST(NodeCrypto, TryGetIntCipherOutputLength) {
11891
int output_len = 0;
11992

Collapse file

‎test/pummel/test-heapdump-secure-context.js‎

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict';
2+
// This tests heap snapshot integration of SecureContext.
3+
4+
const common = require('../common');
5+
6+
if (!common.hasCrypto) common.skip('missing crypto');
7+
8+
const fixtures = require('../common/fixtures');
9+
const {
10+
createJSHeapSnapshot,
11+
validateByRetainingPathFromNodes,
12+
} = require('../common/heap');
13+
const tls = require('tls');
14+
15+
// eslint-disable-next-line no-unused-vars
16+
const ctx = tls.createSecureContext({
17+
cert: fixtures.readKey('agent1-cert.pem'),
18+
key: fixtures.readKey('agent1-key.pem'),
19+
});
20+
21+
{
22+
const nodes = createJSHeapSnapshot();
23+
validateByRetainingPathFromNodes(nodes, 'Node / SecureContext', [
24+
{ edge_name: 'ctx', node_name: 'Node / ctx' },
25+
]);
26+
validateByRetainingPathFromNodes(nodes, 'Node / SecureContext', [
27+
{ edge_name: 'cert', node_name: 'Node / cert' },
28+
]);
29+
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.