-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix libwasmvm
tests for windows and check it in CI
#338
Changes from all commits
8a90f94
7b64f9f
671dfd8
4a10447
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,7 +371,13 @@ mod tests { | |
assert!(cache_ptr.is_null()); | ||
assert!(error_msg.is_some()); | ||
let msg = String::from_utf8(error_msg.consume().unwrap()).unwrap(); | ||
assert_eq!(msg, "Error calling the VM: Cache error: Error creating directory broken\u{0}dir/state: data provided contains a nul byte"); | ||
cfg_if::cfg_if! { | ||
if #[cfg(windows)] { | ||
assert_eq!(msg, "Error calling the VM: Cache error: Error creating directory broken\u{0}dir\\state: strings passed to WinAPI cannot contain NULs"); | ||
} else { | ||
assert_eq!(msg, "Error calling the VM: Cache error: Error creating directory broken\u{0}dir/state: data provided contains a nul byte"); | ||
} | ||
} | ||
} | ||
|
||
#[test] | ||
|
@@ -693,18 +699,17 @@ mod tests { | |
let mut error_msg = UnmanagedVector::default(); | ||
let metrics = get_metrics(cache_ptr, Some(&mut error_msg)); | ||
let _ = error_msg.consume(); | ||
assert_eq!( | ||
metrics, | ||
Metrics { | ||
hits_pinned_memory_cache: 0, | ||
hits_memory_cache: 0, | ||
hits_fs_cache: 1, | ||
misses: 0, | ||
elements_pinned_memory_cache: 1, | ||
elements_memory_cache: 0, | ||
size_pinned_memory_cache: 5665691, | ||
size_memory_cache: 0, | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @uint are you aware of an implementation similar to this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jakub or Bart (I don't remember) actually did that for Isotonic. It's easy to implement. I'd just write our own macro in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be much appreciated! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This particular issue should be solved as part of #351 |
||
assert_eq!(metrics.hits_pinned_memory_cache, 0); | ||
assert_eq!(metrics.hits_memory_cache, 0); | ||
assert_eq!(metrics.hits_fs_cache, 1); | ||
assert_eq!(metrics.misses, 0); | ||
assert_eq!(metrics.elements_pinned_memory_cache, 1); | ||
assert_eq!(metrics.elements_memory_cache, 0); | ||
assert_eq!(metrics.size_memory_cache, 0); | ||
assert_approx_eq::assert_approx_eq!( | ||
i128::from(metrics.size_pinned_memory_cache), | ||
5665691, | ||
665691 | ||
); | ||
|
||
// Unpin | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this error message isn't committed anywhere in the CW state, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's potentially also for third-party uses... for example, there was that issue in ibc-go where it committed the error message from Cosmos SDK and the message changed in Cosmos SDK seemingly non-breaking patches (within Cosmos SDK, it wasn't being committed to state anywhere).
but not sure whether wasmvm or wasmd would be used in a similar manner -- @webmaster128 @ethanfrey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error only happens when initializing cache. In
wasmd
,init_cache
function will get called here during keeper creation. So, I don't think it gets committed to CW state anywhere.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App will panic if this error happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that looks all right then -- I guess it's the similar case with https://github.com/CosmWasm/cosmwasm/pull/1369/files/a2c262d7b205e6aab448e24c790800f07ace2234#diff-a33cf9c4a456c8ddde19ce339a98e000023ad1dbdb34ade052cb401950dcc5daR537