Skip to content

Commit c19e738

Browse files
committed
Fix assertions for rust plugin after updating rustc
Signed-off-by: Matt Leon <mattleon@google.com>
1 parent 591bffc commit c19e738

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

test/runtime_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ TEST_P(TestVm, WasmMemoryLimit) {
132132
// Backtrace
133133
if (engine_ == "v8") {
134134
EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:"));
135-
EXPECT_TRUE(host->isErrorLogged("rg_oom"));
135+
EXPECT_TRUE(host->isErrorLogged("rust_oom"));
136136
EXPECT_TRUE(host->isErrorLogged(" - alloc::alloc::handle_alloc_error"));
137137
}
138138
}
@@ -157,8 +157,8 @@ TEST_P(TestVm, Trap) {
157157
// Backtrace
158158
if (engine_ == "v8") {
159159
EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:"));
160-
EXPECT_TRUE(host->isErrorLogged(" - std::panicking::begin_panic"));
161-
// Check for the function name 'one' in the backtrace, which may appear with or without
160+
EXPECT_TRUE(host->isErrorLogged(" - std::panicking"));
161+
// Check for the function name 'two' in the backtrace, which may appear with or without
162162
// module prefix depending on Rust compiler version and symbol generation.
163163
bool has_one_symbol = host->isErrorLogged("::one") || host->isErrorLogged(" - one");
164164
EXPECT_TRUE(has_one_symbol) << "Expected to find '::one' or ' - one' in backtrace";
@@ -185,7 +185,7 @@ TEST_P(TestVm, Trap2) {
185185
// Backtrace
186186
if (engine_ == "v8") {
187187
EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:"));
188-
EXPECT_TRUE(host->isErrorLogged(" - std::panicking::begin_panic"));
188+
EXPECT_TRUE(host->isErrorLogged(" - std::panicking"));
189189
EXPECT_TRUE(host->isErrorLogged(" - trigger2"));
190190
}
191191
}

test/test_data/trap.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ fn one() {
3636
two();
3737
}
3838

39-
#[inline(never)]
39+
// Proxy-Wasm only prints up to 9 stack frames in V8.
40+
// Ensure that we can see the `one` frame in the stack trace for assertions by inlining two and
41+
// three.
42+
#[inline(always)]
4043
fn two() {
4144
three();
4245
}
4346

44-
#[inline(never)]
47+
#[inline(always)]
4548
fn three() {
4649
panic!("trap!");
4750
}

0 commit comments

Comments
 (0)