Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually use TestGroupOptions.sizeTests #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ssiccha
Copy link
Collaborator

@ssiccha ssiccha commented Dec 15, 2020

No description provided.

@ssiccha ssiccha added the tests label Dec 15, 2020
@ssiccha ssiccha self-assigned this Dec 15, 2020
@codecov
Copy link

codecov bot commented Dec 15, 2020

Codecov Report

Merging #232 (7adffba) into master (174590b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #232   +/-   ##
=======================================
  Coverage   78.49%   78.49%           
=======================================
  Files          37       37           
  Lines       17369    17367    -2     
=======================================
- Hits        13633    13632    -1     
+ Misses       3736     3735    -1     
Impacted Files Coverage Δ
gap/base/recognition.gi 71.84% <100.00%> (+0.05%) ⬆️
gap/base/methsel.gi 94.80% <0.00%> (ø)

@@ -978,7 +978,7 @@ InstallGlobalFunction( "GetCompositionTreeNode",

RECOG.TestGroupOptions := rec(
# Number of times to test whether the recognized size is right
sizeTests := 3,
sizeTests := 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR is named "Actually use TestGroupOptions.sizeTests" but with this change, shouldn't it be named "Actually use TestGroupOptions.sizeTests and change it from 3 to 1"?

Also, why is that change from 3 to 1 desirable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why is that change from 3 to 1 desirable?

Because it more accurately reflects what's already happening. While it looks like we currently run the recognition three times, we actually only do it once if it succeeds. Namely, without this PR, when the recognition succeeds for the first time, the count variable is set to three in the line I deleted.

Copy link
Collaborator Author

@ssiccha ssiccha Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the commit message to:

Actually use TestGroupOptions.sizeTests and ..

.. remove the hack in TestGroup which made it look like the recognition
was run thrice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think that's a difference in understanding what sizeTests is good for: I think the idea was to run the test up to sizeTests times, or until it succeeds, i.e, to deal with flaky recognition that misdetects far too often.

So it makes it "easier" to pass the tests.

This PR changes the semantics of this option substantially. The new variant now might be useful to run a test more often, to make it "harder" to pass it -- that's the opposite.

In any case, we never set a custom value for sizeTests, and I don't think we should, so I'd just remove it altogether, and then change this PR to explain that we removed a hack that made it easier to pass certain tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And while I look at it: perhaps we should also change the default for tryNonGroupElements ? It was off by default in the past because it caused lots of failures. But we worked hard on fixing many of them, and really would like to find any remaining ones.

Copy link
Collaborator Author

@ssiccha ssiccha Dec 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea was to run the test up to sizeTests times, or until it succeeds

If the size is incorrect though, it raises an error Error("Alarm: Size not correct!\n") so I think it was used to make tests harder to pass. But yeah, let's get rid of it! :) I opened a PR #234 for the tryNonGroupElements.

.. remove a hack in TestGroup which made it easier to pass it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants