Skip to content

Possible incorrect stat tests for Links #1232

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

Closed
brianquinlan opened this issue Nov 1, 2021 · 6 comments
Closed

Possible incorrect stat tests for Links #1232

brianquinlan opened this issue Nov 1, 2021 · 6 comments
Assignees

Comments

@brianquinlan
Copy link
Contributor

If I understand the Link/stat_A01_t01.dart test correctly, the test is:

  1. creating a symlink to a directory
  2. calling .stat() on that symlink
  3. expecting the result to be for the symlink (not the underlying directory)

Since every FileSystemEntity relies on FileStat for their .stat() call and since FileStat is documented to call the POSIX stat() function, it seems like the results for the directory should be returned.

This test also fails on my Mac OS X machine:

$ dart --version
Dart SDK version: 2.14.2 (stable) (Wed Sep 15 12:32:06 2021 +0200) on "macos_x64"
$ uname -v
Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64
$ dart tests/co19_2/src/LibTest/io/Link/stat_A01_t01.dart
unittest-suite-wait-for-done
Unhandled exception:
Expect.equals(expected: <link>, actual: <directory>) fails.
#0      _fail (file:///Users/bquinlan/dart/dart-sdk1/sdk/tests/co19_2/src/Utils/expect.dart:22:5)
#1      Expect.equals (file:///Users/bquinlan/dart/dart-sdk1/sdk/tests/co19_2/src/Utils/expect_common.dart:31:5)
#2      _main.<anonymous closure> (file:///Users/bquinlan/dart/dart-sdk1/sdk/tests/co19_2/src/LibTest/io/Link/stat_A01_t01.dart:32:12)
<asynchronous suspension>
#3      _main (file:///Users/bquinlan/dart/dart-sdk1/sdk/tests/co19_2/src/LibTest/io/Link/stat_A01_t01.dart:31:3)
<asynchronous suspension>
#4      inSandbox (file:///Users/bquinlan/dart/dart-sdk1/sdk/tests/co19_2/src/LibTest/io/file_utils.dart:24:12)
<asynchronous suspension>
#5      main (file:///Users/bquinlan/dart/dart-sdk1/sdk/tests/co19_2/src/LibTest/io/Link/stat_A01_t01.dart:25:3)
<asynchronous suspension>

There are some other tests that also verify similar behavior.

@brianquinlan
Copy link
Contributor Author

BTW, I'm happy to submit a fix if we agree on semantics.

@sgrekhov sgrekhov self-assigned this Nov 2, 2021
@sgrekhov
Copy link
Contributor

sgrekhov commented Nov 2, 2021

@brianquinlan thank you. The actual behaviour depends on operation system. I fixed this tests to not to fail on Win, Lunux and Mac. Feel free to reopen the issue if you believe that issue is not fixed completely

@brianquinlan
Copy link
Contributor Author

I actually fixed the Windows behavior in dart-lang/sdk@5e99059.

There are a few more tests like this. I can send you something to review tomorrow.

@sgrekhov
Copy link
Contributor

sgrekhov commented Nov 2, 2021

Please do

@sgrekhov sgrekhov reopened this Nov 2, 2021
@brianquinlan
Copy link
Contributor Author

I have a proposed change at #1233

@sgrekhov
Copy link
Contributor

sgrekhov commented Nov 3, 2021

Merged that PR. Thank you

@sgrekhov sgrekhov closed this as completed Nov 3, 2021
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Nov 11, 2021
2021-11-11 [email protected] dart-lang/co19#1231. More Super parameters tests added
2021-11-10 [email protected] More fix for dart-lang/co19#1094: Missing Issue tags added to LibTest/io tests, minor change for LibTest/core/RangeError/CheckNotNegative_A01_t02
2021-11-10 [email protected] dart-lang/co19#1231. More Super parameters tests added
2021-11-09 [email protected] More fix for dart-lang/co19#1094: co19_2 LibTest/collection/DoubleLinkedQueue tests corrected according to the Issue 27920 evaluation and current behavior.
2021-11-09 [email protected] dart-lang/co19#1231. More Super parameters tests added
2021-11-08 [email protected] dart-lang/co19#1231. Super parameters type inference tests added
2021-11-02 [email protected] Fix tests on Mac OS X. (dart-lang/co19#1233)
2021-11-03 [email protected] dart-lang/co19#1231. More Super parameters tests added
2021-11-02 [email protected] More fix for dart-lang/co19#1094: Missing Issue tags added to LibTest/async tests.
2021-11-02 [email protected] More fix for dart-lang/co19#1094: LanguageFeatures/nnbd tests updated according to the recent dart behaviour, missing Issdue tags added.
2021-11-02 [email protected] More fix for dart-lang/co19#1109: Test LibraryFeatures/nnbd/Least-greatest-closure/typedef/typedef_dynamic_t22 removed according to the issue evaluation, static exception is thrown.
2021-11-02 [email protected] More fix for dart-lang/co19#1094: Test expectation updated for LanguageFeatures/Set-literals/constant_set_literals_A01_t01 test.
2021-11-02 [email protected] Fixes dart-lang/co19#1232. Expect FileStat.type to return underlying object for non-Windows OS's
2021-11-01 [email protected] dart-lang/co19#1231. More super parameters tests added
2021-10-29 [email protected] dart-lang/co19#1231. The first bunch of super parameters tests added
2021-10-28 [email protected] Fixes dart-lang/co19#1228. More named arguments anywhere constructors tests added
2021-10-27 [email protected] dart-lang/co19#1228. More named arguments anywhere tests added
2021-10-26 [email protected] dart-lang/co19#1228. Named arguments anywhere tests added

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Ie70e28bc259aa9bacc3512866e92a2768e456271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220003
Reviewed-by: William Hesse <[email protected]>
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

No branches or pull requests

2 participants