Skip to content

Commit

Permalink
Make wasm-split tests less fragile. NFC (emscripten-core#15150)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Sep 27, 2021
1 parent aca7c12 commit f774eab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/other/test_split_main_module.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
wrote profile of 240 bytes (allocated 240 bytes)
wrote profile data
Hello from main!
Hello from lib!
2 changes: 1 addition & 1 deletion tests/other/test_split_module.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
wrote profile of 228 bytes (allocated 228 bytes)
wrote profile data
Hello! answer: 42
3 changes: 2 additions & 1 deletion tests/other/test_split_module.post.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ function saveProfileData() {
var actualLen = __write_profile(offset, len);
var profile_data = new Uint8Array(buffer, offset, len);
nodeFS.writeFileSync('profile.data', profile_data);
console.log('wrote profile of', actualLen, 'bytes (allocated', len, 'bytes)');
console.log('profile size is', actualLen, 'bytes (allocated', len, 'bytes)');
console.log('wrote profile data')
_free(offset);
}

Expand Down
5 changes: 4 additions & 1 deletion tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -10475,7 +10475,10 @@ def test_split_module(self, customLoader):
self.assertIn('Hello! answer: 42', result)

def test_split_main_module(self):
initialTableSize = 17
# Set and reasonably large initial table size to avoid test fragility.
# The actual number of slots needed is closer to 18 but we don't want
# this test to fail every time that changes.
initialTableSize = 100

side_src = test_file('other/lib_hello.c')
post_js = test_file('other/test_split_module.post.js')
Expand Down

0 comments on commit f774eab

Please sign in to comment.