Skip to content

Commit c460ae5

Browse files
zdevitofacebook-github-bot
authored andcommitted
Fix tensor engine unit test failures (#571)
Summary: Pull Request resolved: #571 Fixes errors like T231366522 which were due to strings not matching correctly when simplifying the error messages. For some reason those tests were not run on the diff. Reviewed By: dulinriley Differential Revision: D78509944 fbshipit-source-id: 494bdc8ea97aec3675bc85cacdc9377885be8537
1 parent 1712f5b commit c460ae5

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

monarch_messages/src/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ pub enum StreamCreationMode {
513513
pub enum CallFunctionError {
514514
#[error("{0}")]
515515
Error(#[from] anyhow::Error),
516-
#[error("Computation depended on an input that failed with errror: {0}")]
516+
#[error("Computation depended on an input that failed with error: {0}")]
517517
DependentError(Arc<CallFunctionError>),
518518
}
519519

monarch_tensor_worker/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ mod tests {
14411441
.context("no such ref")?
14421442
.err()
14431443
.context("expected error")?;
1444-
assert!(mutated_ref.contains("InvalidRemoteFunction"));
1444+
assert!(mutated_ref.contains("failed to resolve function"));
14451445

14461446
let responses = controller_rx.drain();
14471447
assert_eq!(
@@ -2185,7 +2185,7 @@ mod tests {
21852185
value
21862186
.unwrap_err()
21872187
.backtrace
2188-
.contains("InvalidRemoteFunction")
2188+
.contains("failed to resolve function")
21892189
);
21902190
}
21912191
_ => panic!("unexpected response {:#?}", responses),
@@ -2198,7 +2198,7 @@ mod tests {
21982198
value
21992199
.unwrap_err()
22002200
.backtrace
2201-
.contains("InvalidRemoteFunction")
2201+
.contains("failed to resolve function")
22022202
);
22032203
}
22042204
_ => panic!("unexpected response {:#?}", responses),

monarch_tensor_worker/src/stream.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ mod tests {
27362736
let error = result.unwrap().unwrap_err();
27372737

27382738
// Check that the error contains the expected strings
2739-
let error_str = format!("{:?}", error);
2739+
let error_str = error.to_string();
27402740
assert!(
27412741
error_str.contains("recording failed"),
27422742
"Error should contain 'recording failed': {}",
@@ -3034,14 +3034,14 @@ mod tests {
30343034
.unwrap()
30353035
.unwrap_err();
30363036
// Check that the error contains the expected strings
3037-
let error_str = format!("{:?}", result_error);
3037+
let error_str = result_error.to_string();
30383038
assert!(
30393039
error_str.contains("recording failed"),
30403040
"Error should contain 'recording failed': {}",
30413041
error_str
30423042
);
30433043
assert!(
3044-
error_str.contains("torch operator failed"),
3044+
error_str.contains("torch operator error"),
30453045
"Error should contain 'torch operator failed': {}",
30463046
error_str
30473047
);
@@ -3096,7 +3096,7 @@ mod tests {
30963096
.unwrap()
30973097
.unwrap_err();
30983098
// Check that the error contains the expected strings
3099-
let error_str = format!("{:?}", result_error);
3099+
let error_str = result_error.to_string();
31003100
assert!(
31013101
error_str.contains("Computation depended on an input that failed"),
31023102
"Error should contain dependency message: {}",
@@ -3118,7 +3118,7 @@ mod tests {
31183118
3.into(),
31193119
captured_ref,
31203120
&mut test_setup.controller_rx,
3121-
"RecordingFailed",
3121+
"recording failed",
31223122
)
31233123
.await;
31243124

@@ -3477,7 +3477,7 @@ mod tests {
34773477
.unwrap_err();
34783478

34793479
// Check that the error contains the expected strings
3480-
let error_str = format!("{:?}", result_error);
3480+
let error_str = result_error.to_string();
34813481
assert!(
34823482
error_str.contains("Computation depended on an input that failed"),
34833483
"Error should contain dependency message: {}",
@@ -3486,7 +3486,7 @@ mod tests {
34863486

34873487
// Since we're checking for pointer equality in the original code, we need to ensure
34883488
// the error is propagated correctly. We can check that the original error message is contained.
3489-
let input_error_str = format!("{:?}", input_error);
3489+
let input_error_str = input_error.to_string();
34903490
assert!(
34913491
error_str.contains(&input_error_str),
34923492
"Error should contain the original error: {}",
@@ -4232,7 +4232,7 @@ mod tests {
42324232
.unwrap()
42334233
.unwrap_err();
42344234
// Check that the error contains the expected string
4235-
let error_str = format!("{:?}", real_result_err);
4235+
let error_str = real_result_err.to_string();
42364236
assert!(
42374237
error_str.contains("recording failed"),
42384238
"Error should contain 'recording failed': {}",
@@ -4309,7 +4309,7 @@ mod tests {
43094309
.unwrap()
43104310
.unwrap_err();
43114311
// Check that the error contains the expected strings
4312-
let error_str = format!("{:?}", real_result_err);
4312+
let error_str = real_result_err.to_string();
43134313
assert!(
43144314
error_str.contains("Computation depended on an input that failed"),
43154315
"Error should contain dependency message: {}",

0 commit comments

Comments
 (0)