lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [lucenenet] NightOwl888 commented on issue #346: Remove Debugging.AssertsEnabled
Date Wed, 23 Sep 2020 06:30:10 GMT

NightOwl888 commented on issue #346:

   > Couldn't we just add a conditional compilation flag for when compiling the tests projects?
Instead of a #if DEBUG it could be #if TESTING and otherwise the flag just defaults to false
   End users who need to test their extensions in the compiled release will need to enable
the asserts. The [test framework requires asserts to be enabled](
in order to run all of the conditions and throw all of the expected exceptions.
   In addition, the [`CheckIndex` feature is "more thorough" with asserts enabled](
   The main issue is the Lucene designers made no distinction between the `NUnit` asserts
and `Debug.Assert()`. The latter were designed to be able to be turned on in production by
end users as well as during testing.
   Not to mention, what are we actually testing if we rebuild after we test, and how do we
know the final build does what is expected?
   Your results might actually be skewed because you are seeing the initial impact of loading
up the `SystemProperties`. Keep in mind, that is only loaded once per application startup
and stored in a static field and then only has a minimal impact during running. It is crucial
that it is loaded up before the first time it is read (and it is using `LazyInitializer` already
to ensure only 1 thread has the impact).

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message