Skip to content

Treat exceptions thrown by arguments to check as test failures (again) #138

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

Merged
merged 2 commits into from
Apr 12, 2021

Conversation

sorawee
Copy link
Contributor

@sorawee sorawee commented Mar 27, 2021

This PR corrects the wrong fix in #123. It restores the functionality
that #109 is meant to implement while correctly reporting test results.

CC: @AlexKnauth and @wilbowma

This PR corrects the wrong fix in racket#123. It restores the functionality
that racket#109 is meant to implement while correctly reporting test results.
@AlexKnauth
Copy link
Member

It's a shame that conditional is necessary... but yes, this looks like the right thing to do to correct my mistake in #109

@sorawee
Copy link
Contributor Author

sorawee commented Apr 2, 2021

Please don't merge this PR yet. I just discovered several issues when running the test suite. Weirdly, the CI and my local testing last week didn't find any issue...

@AlexKnauth
Copy link
Member

What are the issues?

@sorawee
Copy link
Contributor Author

sorawee commented Apr 9, 2021

Last week when I run raco test rackunit-test there's an error in rackunit-test/tests/rackunit/check-info-test.rkt because the fields are not ordered correctly, but I cannot reproduce it anymore... I don't know what's going on.

Anyway, I just pushed a code to avoid the conditional expression. If the CI returns green, I think it can be merged.

@samth
Copy link
Member

samth commented Apr 9, 2021

We really need to come to a conclusion here. @sorawee @AlexKnauth is this ready to merge?

@AlexKnauth
Copy link
Member

This looks good to me

@samth samth merged commit f943648 into racket:master Apr 12, 2021
@samth
Copy link
Member

samth commented Apr 12, 2021

@racket/release I think this should go in 8.1.

@sorawee sorawee deleted the check-fails-on-exn branch April 12, 2021 02:20
@samth
Copy link
Member

samth commented Apr 12, 2021

@sorawee
Copy link
Contributor Author

sorawee commented Apr 12, 2021

Let's just revert it for now. I don't want it to interfere the 8.1 release.

The issue with CI seems to be that it's not running the current code / current test. I added a test named 109+138.rkt, but that doesn't seem to get run by the CI.

What's more weird is why I couldn't reproduce the issue locally three days ago though now I can...

@samth
Copy link
Member

samth commented Apr 12, 2021

Well, we're past the branch so this isn't interfering with the release.

Why didn't the CI discover the errors that DrDr found? One possibility is that the check-info-test is dependent on hash table ordering, but it also seems to print to stderr, which maybe wasn't noticed by the GHA CI.

@sorawee
Copy link
Contributor Author

sorawee commented Apr 12, 2021

Just saw your message. Are you OK with letting it failing in DrDr?

In any case, I can investigate the issue later this week.

@sorawee
Copy link
Contributor Author

sorawee commented Apr 12, 2021

Why didn't the CI discover the errors that DrDr found? One possibility is that the check-info-test is dependent on hash table ordering, but it also seems to print to stderr, which maybe wasn't noticed by the GHA CI.

It can detect stderr just fine. See the CI error in #139, which is the current error in DrDr.

So I'm even more confident now that the CI downloads the current code from the package server, so it doesn't actually test the change that is being submitted.

@samth
Copy link
Member

samth commented Apr 12, 2021

Yes, that's definitely happening, although I'm not clear on why.

@samth
Copy link
Member

samth commented May 1, 2021

Any further thoughts on the problem here?

@sorawee
Copy link
Contributor Author

sorawee commented May 1, 2021

Sorry, I meant to take a look at this and forgot. Will do that in this weekend.

@samth
Copy link
Member

samth commented May 16, 2021

Ok, I just spent some time looking at this and the problem is pretty fundamental. The issue is that the check-info for a failure during the argument evaluation doesn't have the params info. That check was added by @sorawee in 92b6812. However, that's fundamentally impossible -- the params info is supposed to have the values of the parameters which it can't because we're in the process of evaluating them. The test only passed because the code was doing the wrong thing before this patch (because of #123).

So we have to pick some other behavior. On possibility is the name of the parameter. Another possibility is just blessing the current behavior (although that has a weird consequence in the check-info ordering that causes the other test to fail). Another possibility is #f or something else placeholder-like.

samth added a commit to samth/rackunit that referenced this pull request May 16, 2021
@samth samth mentioned this pull request May 16, 2021
@samth
Copy link
Member

samth commented May 16, 2021

#141 ought to work, but doesn't, for reasons I don't understand.

AlexKnauth added a commit to AlexKnauth/rackunit that referenced this pull request May 31, 2021
When an `exn` is raised, use the check-info stack at the point the exception was raised, not the one at the point `(current-check-around)` was called.
samth added a commit that referenced this pull request Jul 7, 2021
Fix some failures discovered in PR #138 discussion
samth pushed a commit that referenced this pull request Jul 7, 2021
When an `exn` is raised, use the check-info stack at the point the exception was raised, not the one at the point `(current-check-around)` was called.

(cherry picked from commit c9ff45e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants