microsoft / usersim

MIT License
73 stars 22 forks source link

Make fault injection be DEBUG only #86

Closed dthaler closed 1 year ago

dthaler commented 1 year ago

Currently cxplat/src/cxplat_winuser/cxplat_winuser.cpp always enables fault injection and leak detection.

For performance, these should only be enabled on DEBUG builds.

Alan-Jowett commented 1 year ago

I think it makes more sense to move leak detection and fault injection out of cxplat and into usersim.

1) The cxplat kernal and user should behave the same, whereas currently one has explicit leak detection and fault injection, but the other does not. 2) The cxplat library is intended for production use, whereas usersim is currently a testing tool. Leak detection and fault injeciton are test only scenarios.

dthaler commented 1 year ago

I would still like to have leak detection and fault injection (better than AppVerifier currently provides) available in cxplat CI/CD test runs. Will see if we can factor logic out of the main path while leaving it accessible to tests.

nibanks commented 1 year ago

I would also prefer it in cxplat, so projects that only need cross-platform API support can still benefit.

The cxplat kernal and user should behave the same, whereas currently one has explicit leak detection and fault injection, but the other does not.

I agree, and we should fill those gaps.

The cxplat library is intended for production use, whereas usersim is currently a testing tool. Leak detection and fault injeciton are test only scenarios.

Debug mode of cxplat is not intended for production use, so it is a great place to put this kind of stuff.