Skip to content

Commit 6c587af

Browse files
bartlomiejuclaude
andcommitted
fix: relax code_and_metadata_size assertion in heap_code_statistics test
code_and_metadata_size tracks JIT-compiled code, which may be 0 if V8 only uses the interpreter for simple scripts. Assert non-decreasing instead of > 0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 395f612 commit 6c587af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_api.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7823,7 +7823,9 @@ fn heap_code_statistics() {
78237823

78247824
// After compiling code, bytecode_and_metadata_size should increase.
78257825
assert!(s2.bytecode_and_metadata_size() > 0);
7826-
assert!(s2.code_and_metadata_size() > 0);
7826+
// code_and_metadata_size tracks JIT-compiled code, which may be 0 if V8
7827+
// only uses the interpreter for simple scripts.
7828+
assert!(s2.code_and_metadata_size() >= s.code_and_metadata_size());
78277829
}
78287830

78297831
#[test]

0 commit comments

Comments
 (0)