Workaround bug in Travis? #489

Closed
wants to merge 1 commit into from

4 participants

@cpina
Citation Style Language member

Travis said "The log length has exceeded the limit of 4 Megabytes (this usually means that test suite is raising the same exception over and over)."
Watching the log I don't see 4 MB of data (https://travis-ci.org/citation-style-language/styles/builds/6688872)
Someone may contact Travis but this patch tries to print less "." just in case this fixes the problem for the time being.

@cpina
Citation Style Language member

Ops, correction: the git commands may generate more output than what it looks. I'll have a second thought...

@rmzelle
Citation Style Language member

I think it's because of the Fuubar progress formatter, which does a lot of redrawing. I'm not sure how to disable it, though.

@cpina
Citation Style Language member

Actually indeed they do: pressing on the Travis webpage (https://travis-ci.org/citation-style-language/styles/builds/6688872 ) the "Download Log" (it's an option on the icon at the right): https://s3.amazonaws.com/archive.travis-ci.org/jobs/6688873/log.txt it shows a file of about 4 MB: https://s3.amazonaws.com/archive.travis-ci.org/jobs/6688873/log.txt

The "git clone" that Travis is doing should have the option "-q" to avoid too much verbosity. I'm not familiar with Travis but I guess that should be easy to do.

@cpina
Citation Style Language member

@rmzelle : do you have some Travis credentials?

@rmzelle
Citation Style Language member

I reported the issue with the Fuubar project: thekompanee/fuubar#39

@rmzelle
Citation Style Language member

And while the git cloning could be less verbose, that's not the biggest issue.

@cpina
Citation Style Language member

You are right, it's another command that generates all that output.

@cpina cpina closed this Apr 27, 2013
@rmzelle
Citation Style Language member

@inukshuk, do you know how to disable Fuubar in the meantime?

@inukshuk
Citation Style Language member

Yes, I switched to the regular progess reporter here – this way it does not error anymore on travis, but the log output is pretty useless. I'll take a look at how the rspec formatters work. For our purposes I figure it would be sufficient to only report errors and not tests that succeed.

@inukshuk
Citation Style Language member

Guys, I added a custom formatter here: #98fc903.

This should now produce sane output (currently there's real error with the plasmonics style). Fingers crossed!

@inukshuk
Citation Style Language member
@jfelchner

Hey all, I think I finally have this taken care of now.

I've added both a #log statement to ruby-progressbar (which will remove the bar, print some text and the redraw the bar) as well as proper non-TTY output. The bar will only print to non-TTY device if the bar is stopped or finished.

This will be released today as v1.2 so if you have fuubar v1.1.1 or later, you can simply bundle update ruby-progressbar.

If you wouldn't mind trying this out on Travis and let me know if it works for you, I'd appreciate it!

@rmzelle
Citation Style Language member

@inukshuk, can you make the required changes once ruby-progressbar 1.2 is out so we can test this? Feel free to push directly to the repo.

Judging from dfe3e2b , I guess some changes have to be made to the "Gemfile" and "Rakefile" files?

@inukshuk
Citation Style Language member

@jfelchner awesome, thanks for the heads-up!

@rmzelle I'm currently out of town, but I can try it out as soon as I'm back home next week. Meanwhile, however, if I understand this correctly, all you need to do once 1.2 is ready is to:

  • move the line gem 'fuubar' out of the :extra group — this will make travis fetch fuubar for our build
  • change the default format to 'Fuubar' instead of 'progress' in the Rakefile on the spec.rspec_opts line

In case you want to try that out beforehand.

@rmzelle
Citation Style Language member

Yeah, that's what I grasped as well without knowing any Ruby :). I'll give it a try this evening.

@jfelchner

v1.2.0 has just been pushed to rubygems. Hopefully I didn't break anything too badly. :)

@rmzelle rmzelle added a commit that referenced this pull request Aug 13, 2013
@rmzelle rmzelle Try going back to using Fuubar per #489 9ae30a9
@jfelchner

@rmzelle ok, the ASCII codes will be fixed in a bugfix release of fuubar that I will release tonight. We added throttling to ruby-progressbar so it only updates every 1/100th of a second so that's why you're no longer seeing every progress update.

This fact alone means that you may be able to get in under the log file size limit (and therefore be able to leave fuubar as the default rspec formatter).

Unfortunately, you're still seeing multiple updates, this shows that progressbar still considers the Travis log to be a TTY device. Have you all been in contact with the Travis folks about this?

@rmzelle
Citation Style Language member

No, not yet.

@rmzelle
Citation Style Language member

@jfelchner, would you mind creating a Travis issue? The only relevant comment I could find is travis-ci/travis-ci#1114 (comment) .

@inukshuk
Citation Style Language member

@rmzelle anything I should do?

I guess we could stick with progress on Travis for now and make fuubar the default otherwise. I could add a switch that checks for any of the Travis CI environment variables.

Even better, I guess would be to add a custom formatter that only reports the errors and skips printing anything else (I mean, we're really only interested in the error messages anyway).

@jfelchner

@inukshuk I think for now that making progress the default would be the way to go. Once I have an update from that Travis issue, I'll update this issue again and we can revisit it.

Thanks for sticking with me to try to make this work.

@rmzelle
Citation Style Language member

@jfelchner, any chance of a strong throttling option for fuubar, e.g. limit refreshes to once per second and once per percent progress? That would help a lot. (this would also reduce the line flickering in my local terminal window)

@jfelchner

@rmzelle one open feature request on fuubar is to expose the underlying progressbar options. Once I do that, you can set it to whatever you want in your RSpec configuration.

@rmzelle rmzelle referenced this pull request in travis-ci/travis-ci Aug 20, 2013
Closed

Travis Log TTY Issues #1337

@inukshuk inukshuk added a commit that referenced this pull request Aug 20, 2013
@inukshuk inukshuk use progress formatter on travis-ci
see #489
090835a
@inukshuk inukshuk added a commit that referenced this pull request Aug 20, 2013
@inukshuk inukshuk use progress formatter on travis-ci
see #489
4adc126
@inukshuk
Citation Style Language member

Here is a better link:

https://travis-ci.org/inukshuk/styles/builds/10411645

Fuubar seems to have worked on travis?

@rmzelle
Citation Style Language member

@inukshuk, we're also back to using fuubar for the official CSL styles repo. The reason fuubar currently works is "We added throttling to ruby-progressbar so it only updates every 1/100th of a second so that's why you're no longer seeing every progress update." (see #489 (comment) above). The log of your build is still pretty big, though: https://s3.amazonaws.com/archive.travis-ci.org/jobs/10411646/log.txt

@inukshuk
Citation Style Language member

Ah, sorry for not paying attention.

Anyway, I also added a switch to the Rakefile in case you want to pass different options on Travis in the future. See here: https://github.com/citation-style-language/styles/blob/master/Rakefile#L14

@jfelchner

Hey all, I know it's been a while, but I think that all the work we discussed has been completed now.

Assuming the TravisCI folks have added the CONTINUOUS_INTEGRATION environment variable, the bar will remove all colors (even if the --color RSpec flag is passed) and will only output the bar once per second.

That's the best I can do right now, but I am eventually planning on adding a force_no_tty option to ruby-progressbar which will let me use the new non-TTY format when CONTINUOUS_INTEGRATION is set. Once this happens, the only duplicate bars which will be shown will be if other output is logged (like a failure).

For reference on the CONTINUOUS_INTEGRATION variable, see the TravisCI issue

@rmzelle
Citation Style Language member

I updated my bundle, but now I get a few warnings from RSpec. @inukshuk, do you have some time to troubleshoot this before I push the updated Gemfile to GitHub?

rintze-zelles-macbook:styles rintzezelle$ bundle exec rake
/usr/local/Cellar/ruby/2.0.0-p0/bin/ruby -S rspec ./spec/dependent_styles_spec.rb ./spec/independent_styles_spec.rb ./spec/repository_spec.rb --require spec_helper.rb --format Fuubar --color

Loading dependent styles.................................................
Loading independent styles........
 115707/115707 |==================== 100 ====================>| Time: 00:03:54 

Finished in 3 minutes 54.3 seconds
115707 examples, 0 failures

rintze-zelles-macbook:styles rintzezelle$ bundle update
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0) 
Installing namae (0.8.0) 
Using csl (1.0.2) 
Installing diff-lcs (1.2.5) 
Installing rspec-core (2.14.7) 
Installing rspec-expectations (2.14.4) 
Installing rspec-mocks (2.14.4) 
Using rspec (2.14.1) 
Installing ruby-progressbar (1.3.2) 
Installing fuubar (1.3.0) 
Installing mini_portile (0.5.2) 
Installing nokogiri (1.6.1) 
Using bundler (1.3.4) 
Your bundle is updated!

rintze-zelles-macbook:styles rintzezelle$ bundle exec rake
/usr/local/Cellar/ruby/2.0.0-p0/bin/ruby -S rspec ./spec/dependent_styles_spec.rb ./spec/independent_styles_spec.rb ./spec/repository_spec.rb --require spec_helper.rb --format Fuubar --color

Loading dependent styles.................................................
Loading independent styles........
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:901: warning: already initialized constant RSpec::Core::Configuration::DEFAULT_FORMATTER
/usr/local/lib/ruby/gems/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:901: warning: previous definition of DEFAULT_FORMATTER was here
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:938: warning: already initialized constant RSpec::Core::Configuration::DEFAULT_ORDERING
/usr/local/lib/ruby/gems/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:938: warning: previous definition of DEFAULT_ORDERING was here
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:941: warning: already initialized constant RSpec::Core::Configuration::RANDOM_ORDERING
/usr/local/lib/ruby/gems/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:941: warning: previous definition of RANDOM_ORDERING was here
 115707/115707 |==================== 100 ====================>| Time: 00:04:16 

Finished in 4 minutes 16.2 seconds
115707 examples, 0 failures
rintze-zelles-macbook:styles rintzezelle$ 
@jfelchner

Guys, I just realized this may be a bug introduced in the latest fuubar. Give me a second to push a fix.

@jfelchner

Ok all, I just pushed v1.3.1 of fuubar. Lemme know if that fixes your problem (or introduces new ones 😄)

@rmzelle
Citation Style Language member

Thanks, that cleared things up!

@jfelchner

@rmzelle perfect. Let me know if that helps. If Travis hasn't set the env variable automatically yet, I think there's capability in the YAML file to set environment variables there.

If you set CONTINUOUS_INTEGRATION to anything (except false), it should trigger the new colorless throttling.

@rmzelle
Citation Style Language member

The log of the latest build is still pretty verbose, so my guess is that the variable isn't set. See

https://travis-ci.org/citation-style-language/styles/builds/15547670
and
https://s3.amazonaws.com/archive.travis-ci.org/jobs/15547671/log.txt

I'll try the YAML thing.

@jfelchner

@rmzelle the fact that the color codes are still being output means that it is definitely not being set.

@jfelchner

@rmzelle can you gist your Gemfile for me? Someone else is having a similar issue that I'm trying to track down. Since fuubar is working for you, I'd like to see what the differences are.

@rmzelle
Citation Style Language member
@rmzelle
Citation Style Language member

And the .travis.yml file, which now sets the environment variable: 6d9c9c9

@jfelchner

BOOM! 😀 Glad we could finally get this sorted for you all!!

@rmzelle
Citation Style Language member

Thanks a lot! Early Christmas present :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment