-
Notifications
You must be signed in to change notification settings - Fork 213
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
Exit code of 0 after a failed test #2248
Comments
Can you create a reproduction case that doesn't require docker? |
@jakemac53 i don't think we can create a replication for this without docker in a reasonable time frame. I also suspect that at the heart of this is a bunch of async stuff leading to a race condition, and the docker based services provide a substrate for that to happen. |
@cpswan can you provide more of the error logs? |
Fwiw, I have validated that late async errors in |
@jacob314 I already attached the full log archive from the original GitHub Actions run where we first spotted this (and the specific log within that archive is 2_functional_tests_at_onboarding_cli (at_onboarding_cli_functional_tests).txt. What other logs can I get for you? |
Sorry I missed the logs initially, checking over them now |
@cpswan I don't see anything obvious, I created a branch of test_core with some extra print statements just to get an idea of what state the runner thinks it is in. If you can run using that link the result that would help to get a start here, you should be able to use it by adding something like this to your pubspec: dependency_overrides:
test_api:
git:
url: https://github.com/dart-lang/test/
ref: add-prints
path: pkgs/test_api
test_core:
git:
url: https://github.com/dart-lang/test/
ref: add-prints
path: pkgs/test_core
test:
git:
url: https://github.com/dart-lang/test/
ref: add-prints
path: pkgs/test |
Another thing that might be worth testing, is that dart apps running under docker can in general set exit codes properly, so you could try running this app: import 'dart:io';
void main() {
exitCode = 1;
} |
@jakemac53 the app in the container (and any exit codes it may set) should be entirely irrelevant, as it's just providing a set of APIs that the tests run against. As it happens, the stuff in the container is a Dart AOT binary. But we don't expect the container itself to exit, or in any way communicate its exit code (should it have one) into the tests. I'll have a go at running the extra prints tests. |
Oh right, you are not running |
I set dependency overrides per #2248 (comment) and ran
Here's the output from
I'm not noticing any extra prints there. |
They should appear at the very end of the output of |
@jakemac53 whatever happened, those prints weren’t reached, which I guess tells its own story. |
That is indeed interesting... is it possible that The prints I added will only work if using the actual test runner executable, and running test files like |
@jakemac53 I don’t think we’re doing anything to make Going back to when we first saw this, it was in a GitHub Actions runner, which guarantees a known clean environment. |
Is it possible that some of the code under test is calling |
@jakemac53 yep, I think that's what's happening. I see a Does this now take us into a question of expected behaviour? I wouldn't expect an exit(0) from a later test to override unrelated failures from earlier tests. But I'm also painfully aware that such things have been litigated in threads like these before (and not always found their way into more visible documentation). |
Unfortunately it does. When you call As far as I know, there is no way for us to change this, or to warn when it happens. We cannot intercept the cc @bkonyi - in case I'm overlooking some VM capability.
It's not so much a behavior of overriding other earlier test failures, as it is that the exit code is no longer in the control of the test runner because the test code is forcing it to |
@bkonyi - another idea I just had since we already do hardcode some test knowledge in the SDK and Dart CLI. Do you think it would be feasible (and sensible) to change the behavior of |
Sorry, don't know how I missed this. I'm not sure that we're going to be willing to change the behavior of Is this something users are encountering frequently? If this is a common issue, it might be something worth investigating, but initial conversations with the VM team haven't been very positive. |
This comes up infrequently enough that when it does it usually takes us a while to remember what to look for. The main motivation for wanting a change here is this is nasty to debug whenever it does come up. It may have come up again in dart-lang/sdk#56254 which could be a sign that we'll be seeing this more often. One thing we can do at least is add extra logging like what Jake used behind a |
I've got a CL up for review to add |
Describe the bug in detail.
A test (or tests) fail, but the exit code for the
dart test
process is 0.@gkc first noticed this on a GitHub Action run. (Full logs at logs_24055523517.zip.)
However the job still passed.
This was initially thought to be an issue with GitHub Actions, and @gkc opened atsign-foundation/at_libraries#586 but the behavior has since been replicated locally, so it looks like it's a
dart test
problem rather than a GitHub Actions problem.Include the specific command you ran and any relevant details about the
environment, including operating system, Dart SDK version, and the version of
package:test
you are using.dart test --concurrency=1
Dart SDK version: 3.4.1 (stable) (Tue May 21 15:46:25 2024 +0000) on "linux_x64"
Whenever possible, include a full reproduction example that we can run to
observe the problem.
This will need Docker Compose.
@mit-mit this is the thing I mentioned to you last week at I/O Connect, so this is the GitHub issue you asked me to open.
The text was updated successfully, but these errors were encountered: