Skip to content

Commit 1506cbc

Browse files
committed
[bfops/wasm-test]: bugfix
1 parent 47fa3f4 commit 1506cbc

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • sdks/rust/tests/test-counter/src

sdks/rust/tests/test-counter/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,20 @@ impl TestCounter {
142142
inner.outcomes.len() == inner.registered.len()
143143
};
144144

145+
let mut finished = false;
145146
for _ in 0..MAX_WAIT_ITERATIONS {
146147
if all_tests_finished() {
147-
return;
148+
// We still need the final outcome pass below. Returning here would incorrectly
149+
// treat recorded `Err(...)` test outcomes as success, including harness tests that
150+
// intentionally exercise the failure path.
151+
finished = true;
152+
break;
148153
}
149154
TimeoutFuture::new(WAIT_INTERVAL_MS).await;
150155
}
151156

152157
let lock = self.inner.lock().expect("TestCounterInner Mutex is poisoned");
153-
if lock.outcomes.len() != lock.registered.len() {
158+
if !finished || lock.outcomes.len() != lock.registered.len() {
154159
let mut timeout_count = 0;
155160
let mut failed_count = 0;
156161
for test in lock.registered.iter() {

0 commit comments

Comments
 (0)