-
Notifications
You must be signed in to change notification settings - Fork 25
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
tests for #135 #241
tests for #135 #241
Conversation
src/protocol/context.rs
Outdated
} | ||
|
||
#[tokio::test] | ||
pub async fn narrow() -> Result<(), BoxError> { |
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 seems that you don't need those tests to be async?
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.
I tried changing them to regular tests, but there is a call to tokio::spawn
within InMemoryNetwork::new
within make_world
.
471dd9c
to
273ce34
Compare
// // do something *without* narrowing context by `i` or using it as RecordId | ||
// } | ||
// ``` | ||
#[ignore] // broken, see #135 |
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.
I'm not sure what the material difference is between this test and the previous one. What am I missing?
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.
The idea is that, in the specific case where i
is a record ID, narrowing a context twice in this way should not be an error. It is okay to construct the same context path multiple times, as long as you're doing it for different record IDs.
In the test case it would be possible to avoid the issue by moving the call to narrow
outside the loop, but in general the body of the for record_id
loop can be spread across multiple functions and it may not be desirable to pull the calls to narrow
all the way up. (main...andyleiserson:ipa:issue135 shows what that might look like.)
No longer applicable after #253. |
Some tests I wrote for #135. Haven't settled on a strategy yet.