Fix flaky LambdaSyntaxTest#460
Conversation
|
Fixes #443. |
|
I am not sure if the main goal for this example is preserved. Since it affects the master branch, it has to wait for the next tag. |
|
Personal identifier: GUID: {B62EA543-97CE-4E8B-8167-8C4D97A71094} |
|
Many thanks, @braguex10, for your contribution. I will appreciate. |
|
The most important thing in this test ( You are right that the previous solution is not deterministic because it uses statistics, but it seems to me that it is too complicated and doesn't present the idea in question. I must consider removing this test altogether. I am using test methods to explain selected ideas, but not to validate the correctness of a program. |
This pull request fixes issue #443.
The LambdaSyntaxTest previously used Random to generate test data. Because of that, the number of values greater than or equal to 50 could occasionally fall outside the expected tolerance, causing the test to fail randomly.
The test data is now deterministic. The buffer contains exactly half values below 50 and half values greater than or equal to 50. This keeps the purpose of the test, which is to verify the lambda expression used by Count, while removing the random behavior.