Peculiar errors thrown by dart vm and firefox in CI build

Hi @athomas and @a14n , the build is failing and I dont understand how the CI has a different output for one test in span_test.dart, and the commands “pub run test -p vm”, “pub run test -p firefox” dont throw any errors on my machine. I would be glad if someone could point me in the right direction ?
my output-

[adarshm26@dell yaml]$ pub run test -p vm
00:01 +98: test/yaml_test.dart: 6.8: Directives [Example 6.13]                 
line 1, column 1: Warning: unknown directive.
  ╷
1 │ %FOO  bar baz # Should be ignored
  │ ^^^^
  ╵
00:01 +99: test/yaml_test.dart: 6.8: Directives [Example 6.14]                 
line 1, column 1: Warning: this parser only supports YAML 1.1 and 1.2.
  ╷
1 │ %YAML 1.3 # Attempt parsing
  │ ^^^^^^^^^
  ╵
00:02 +166: All tests passed!     

[adarshm26@dell yaml]$ pub run test -p firefox
00:06 +0: compiling test/span_test.dart                                        
Compiled 9,138,241 characters Dart to 1,219,940 characters JavaScript in 6.04 seconds
Dart file /tmp/dart_test_HIYZGI/runInBrowser.dart compiled to JavaScript: /tmp/dart_test_UWOTFO/test_SKXRCD/span_test.dart.browser_test.dart.js

00:06 +0: compiling test/yaml_test.dart                                        
Compiled 9,182,758 characters Dart to 1,313,565 characters JavaScript in 6.13 seconds
Dart file /tmp/dart_test_KBYYZL/runInBrowser.dart compiled to JavaScript: /tmp/dart_test_UWOTFO/test_AUSOUE/yaml_test.dart.browser_test.dart.js

00:06 +0: compiling test/yaml_node_wrapper_test.dart                           
Compiled 9,139,307 characters Dart to 1,125,875 characters JavaScript in 6.26 seconds
Dart file /tmp/dart_test_PANZTW/runInBrowser.dart compiled to JavaScript: /tmp/dart_test_UWOTFO/test_TCSNWK/yaml_node_wrapper_test.dart.browser_test.dart.js

00:09 +98: test/yaml_test.dart: 6.8: Directives [Example 6.13]                 
line 1, column 1: Warning: unknown directive.
  ╷
1 │ %FOO  bar baz # Should be ignored
  │ ^^^^
  ╵
00:09 +99: test/yaml_test.dart: 6.8: Directives [Example 6.14]                 
line 1, column 1: Warning: this parser only supports YAML 1.1 and 1.2.
  ╷
1 │ %YAML 1.3 # Attempt parsing
  │ ^^^^^^^^^
  ╵
00:10 +166: All tests passed!   

It also seems to pass on the latest dev release: https://travis-ci.org/github/dart-lang/yaml/jobs/677661084

Did you try running the tests with Dart 2.4.0 locally?

1 Like

Since those definitely are intended to be invalid directives, I reckon you have disabled those warnings locally.

These message also have nothing to do with the actual failure as you can see if you look at the log closely.

Not on 2.4.0, it runs fine and as expected on 2.7.2. Thing is, the file span_test.dart contains tests that are similar to the one which throws error. According to the error there are less whitespaces(’ ') in each line of the expected string. This should not be possible. The method call should produce the expected string in the same format as all other test’s expected string. How can one particular test have less whitespaces while others have the expected amount? I understand that build environments can affect how tabs are interpreted by the compiler, but then it should uniformly affect all cases, right?

I have seen the log, please see my previous reply

To me it looks like you’ve hit an odd bug in the Dart SDK or a package that you depend on. The 2.4.0 build environment and the 2.9.0 build environment are quite far apart: besides the SDKs being different, they also pull in different versions of your dependencies because of the SDK constraints in those packages (you can see that if you expand the $ pub get line in the failing and the succeeding builds).

I don’t see any indication of this being a problem with the Dart-Travis integration. Which leaves you with a few options:
a) Search for similar bugs that have been fixed (given that it works in the latest version) in the packages that have changed version and in the Dart SDK.
b) Try to create a minimal reproduction of this issue and submit a bug to the repo that is most likely causing this to fail.
c) Download 2.4.0 and debug the problem.
d) Try to find out with which Dart SDK this test starts to work and increase the lower bound of your package’s SDK constraint.

1 Like

I just noticed that this is dart-lang/yaml. So you might have to discuss the issue with one of that package’s authors (they are unlikely to hang around in this Travis community). They might be OK with just raising the lower bound to an SDK version that doesn’t have this issue.

Thank you very much for the detailed response. I will try your suggestions and also try to get a response from the repo’s maintainers.

I found the bug, it was from the dependency ‘source_span’. Thank you again, I was really lost there.

1 Like
Imprint