Skip to content

Commit cd5f6ed

Browse files
authored
Avoid flakiness in other.test_exceptions_rethrow_stack_trace_and_message (#20792)
The test checked that "bar " was not contained in the output, but randomly the name of the directory we run in can contain it... which led to a flake here: https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8763235314082986593/+/u/Emscripten_testsuite__other_/stdout > at EmscriptenEH (/b/s/w/ir/x/t/emtest_bji7rbs8/emscripten_test_other_2p1hbarc/src.js:714:1) To reduce that chance practically to nothing make the function name much longer.
1 parent f386451 commit cd5f6ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/test_other.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -8740,12 +8740,12 @@ def test_exceptions_rethrow_stack_trace_and_message(self, wasm_eh):
87408740
rethrow_src1 = r'''
87418741
#include <stdexcept>
87428742

8743-
void bar() {
8743+
void important_function() {
87448744
throw std::runtime_error("my message");
87458745
}
87468746
void foo() {
87478747
try {
8748-
bar();
8748+
important_function();
87498749
} catch (...) {
87508750
throw; // rethrowing by throw;
87518751
}
@@ -8758,12 +8758,12 @@ def test_exceptions_rethrow_stack_trace_and_message(self, wasm_eh):
87588758
rethrow_src2 = r'''
87598759
#include <stdexcept>
87608760

8761-
void bar() {
8761+
void important_function() {
87628762
throw std::runtime_error("my message");
87638763
}
87648764
void foo() {
87658765
try {
8766-
bar();
8766+
important_function();
87678767
} catch (...) {
87688768
auto e = std::current_exception();
87698769
std::rethrow_exception(e); // rethrowing by std::rethrow_exception
@@ -8783,10 +8783,10 @@ def test_exceptions_rethrow_stack_trace_and_message(self, wasm_eh):
87838783
self.set_setting('ASSERTIONS', 1)
87848784
err = self.do_run(rethrow_src1, assert_all=True, assert_returncode=NON_ZERO,
87858785
expected_output=rethrow_stack_trace_checks, regex=True)
8786-
self.assertNotContained('bar', err)
8786+
self.assertNotContained('important_function', err)
87878787
err = self.do_run(rethrow_src2, assert_all=True, assert_returncode=NON_ZERO,
87888788
expected_output=rethrow_stack_trace_checks, regex=True)
8789-
self.assertNotContained('bar', err)
8789+
self.assertNotContained('important_function', err)
87908790

87918791
@requires_node
87928792
def test_jsrun(self):

0 commit comments

Comments
 (0)