You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if a container started using TestContext::start_container crashes, when ContainerContext::address_for_port is used, it returns None - which means the typical .unwrap() call on the return value fails with a "Unwrapping None value" type error, which isn't very descriptive.
The fix for this might end up being related to #446 (ie: for long running containers, at least check they are still running before handing over control to the context), or else we could make the return type of ContainerContext be a Result where the error variant has a more descriptive message ("is this the correct port, or could the server have crashed?" etc).
As a workaround, I added assert_empty!(container.logs_now().stderr) type usages prior to the address_for_port call, to ensure any crash error messages cause an earlier (and easier to debug) failure than the address_for_port None unwrap.
Since:
- There was already duplication of formatting stderr/stdout output,
which was otherwise going to get worse after #636.
- It may also be useful for end users when debugging, to save them
having to manually print both stderr and stdout manually.
Prep for #482.
GUS-W-13966399.
Improves the debugging UX for several `ContainerContext::address_for_port`
failure modes.
In particular, if containers crash after startup then the container logs
are now included in the panic error message, rather than only the
potentially confusing "No public port X published" message from Docker.
Fixes#482.
GUS-W-13966399.
Currently, if a container started using
TestContext::start_container
crashes, whenContainerContext::address_for_port
is used, it returnsNone
- which means the typical.unwrap()
call on the return value fails with a "Unwrapping None value" type error, which isn't very descriptive.The fix for this might end up being related to #446 (ie: for long running containers, at least check they are still running before handing over control to the context), or else we could make the return type of
ContainerContext
be aResult
where the error variant has a more descriptive message ("is this the correct port, or could the server have crashed?" etc).As a workaround, I added
assert_empty!(container.logs_now().stderr)
type usages prior to theaddress_for_port
call, to ensure any crash error messages cause an earlier (and easier to debug) failure than theaddress_for_port
None unwrap.GUS-W-13966399.
The text was updated successfully, but these errors were encountered: