Git Product home page Git Product logo

Comments (2)

jamesderlin avatar jamesderlin commented on April 28, 2024

I've been trying to fix some other test flakiness (which might address that ENOENT error) and have been running hundreds of test iterations, and I've also been hitting failures related to access timestamps:

00:03 +13 ~2: loading test/local_test.dart
  Expected: a DateTime <= 2020-06-19 11:09:37.999
    Actual: DateTime:<2020-06-19 11:09:38.000>
     Which: is after 2020-06-19 11:09:37.999 by 0:00:00.001000

  package:test_api                expect
  test/common_tests.dart 1597:11  runCommonTests.<fn>.<fn>.<fn>.<fn>
00:03 +13 ~2: loading test/local_test.dart
  Expected: a DateTime <= 2020-06-19 11:44:49.997
    Actual: DateTime:<2020-06-19 11:44:50.000>
     Which: is after 2020-06-19 11:44:49.997 by 0:00:00.003000
  
  package:test_api                expect
  test/common_tests.dart 1661:11  runCommonTests.<fn>.<fn>.<fn>.<fn>
00:05 +549 ~4 -1: ChrootFileSystem localBacked common File lastModified isNowForNewlyCreatedFile [E]
  Expected: a DateTime <= 2020-06-19 11:58:33.000
    Actual: DateTime:<2020-06-19 11:58:34.000>
     Which: is after 2020-06-19 11:58:33.000 by 0:00:01.000000

  package:test_api                expect
  test/common_tests.dart 1638:11  runCommonTests.<fn>.<fn>.<fn>.<fn>

In all of the cases, the "Actual" value seems to be at an exact second, which probably isn't coincidental.

I don't see anything obviously wrong with the test code and so far haven't been able to successfully simulate the failure. (As an aside, ceil([DateTime]) is misleading since it's not a mathematical ceiling, but I think it does behave as intended. I think it'd be clearer to replace ceil() with floor() + oneSecond though.)

from file.dart.

jamesderlin avatar jamesderlin commented on April 28, 2024

I believe the ENOENT errors should be fixed by #150.

In all of the cases, the "Actual" value seems to be at an exact second, which probably isn't coincidental.

This is a red herring. I misread the test. Those "Actual" times are the ones rounded down by floor(), so it's expected that they are at an exact second. The "Expected" time is the file's access time. (That's confusing; we should change those expect() calls since it's the access time that is being tested.)

Anyway, I made a reproduction case by distilling one of the modification time tests down and running it in a continuous loop for 1 second. (The modification time tests can hit a similar failure as the access time ones, and with modification times I don't need to worry about potential weirdness from noatime or relatime settings.) The failure also happens when using dart:io's File directly, and so far I've been unable to reproduce it with an analogous C program, so I think that the timestamp discrepancy is from some weirdness in the SDK or in the VM. I'll file an SDK bug.

from file.dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.