runtime-tools icon indicating copy to clipboard operation
runtime-tools copied to clipboard

using util.Fatal in a right way

Open liangchenye opened this issue 7 years ago • 3 comments

In some tests, we are using 'util.Fatal'. It exits immediately, so 'defer' functions will not be called. We will leave the testing bunde dir or a container. It needs to be fixed.

liangchenye avatar Feb 13 '18 02:02 liangchenye

Another issue I found in reviewing https://github.com/opencontainers/runtime-tools/pull/640. We need a patch to make RuntimeInsideValidate and RuntimeOutsideValidate stronger. Now it does not different runtime error and runtime-tool/system error.

liangchenye avatar May 24 '18 03:05 liangchenye

I've just happened to see this issue, and it's true that a defer function does not run when util.Fatal is called. So far I have been also making such mistakes. I agree that we should fix it, although there are many places to touch.

dongsupark avatar May 31 '18 11:05 dongsupark

If I understand correctly, this issue can be closed now. The original issue, using util.Fatal correctly, was addressed by https://github.com/opencontainers/runtime-tools/pull/645. The second issue, differentiation of runtime-tools TAP errors and system errors was done by https://github.com/opencontainers/runtime-tools/pull/658.

dongsupark avatar Aug 22 '18 15:08 dongsupark