Skip to content

Commit 4529dcd

Browse files
fix: resolve test concurrency issue in dash-spv-ffi error handling
- Add #[serial] attributes to error-handling tests to prevent race conditions - Tests were failing due to concurrent access to global error state - Ensures tests run sequentially to avoid interference between test cases - Fixes CI failure: 'assertion failed: error_ptr.is_null()'
1 parent 749805e commit 4529dcd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dash-spv-ffi/tests/test_error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#[cfg(test)]
22
mod tests {
33
use dash_spv_ffi::*;
4+
use serial_test::serial;
45
use std::ffi::CStr;
56

67
#[test]
8+
#[serial]
79
fn test_error_handling() {
810
clear_last_error();
911

@@ -26,6 +28,7 @@ mod tests {
2628
}
2729

2830
#[test]
31+
#[serial]
2932
fn test_error_codes() {
3033
assert_eq!(FFIErrorCode::Success as i32, 0);
3134
assert_eq!(FFIErrorCode::NullPointer as i32, 1);
@@ -41,6 +44,7 @@ mod tests {
4144
}
4245

4346
#[test]
47+
#[serial]
4448
fn test_handle_error() {
4549
let ok_result: Result<i32, String> = Ok(42);
4650
let handled = handle_error(ok_result);

dash-spv-ffi/tests/unit/test_error_handling.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ mod tests {
156156
}
157157

158158
#[test]
159+
#[serial]
159160
fn test_null_pointer_error_handling() {
160161
// Test null_check! macro behavior
161162
unsafe {
@@ -183,6 +184,7 @@ mod tests {
183184
}
184185

185186
#[test]
187+
#[serial]
186188
fn test_handle_error_helper() {
187189
// Test Ok case
188190
let ok_result: Result<i32, String> = Ok(42);

0 commit comments

Comments
 (0)