view · edit · sidebar · attach · print · history

20110912-debug-importer-testcases-migel

<< | Index | >>


  1. Debug segmentation fault
  2. Testcases migel

Goal/Estimate/Evaluation:

  • Testcases migel / 100% / 95%
Milestones
  1. testcases migel
ToDo
  • Migel.logger test
  • require 'migel/util/m10l_document' problem in multilingual.rb
  • require 'oddb/util/m10l_document' problem in model_super.rb
  • 'could not sort' warning -> this is caused by probably to_s method
  • RangeError 0x3fd07d5c4ee0 is recycled object

Debug segmentation fault

Log (the last run with 'sleep 0.01' method after the instance creating part)

migel> Migel::Util::Importer.new.update('data/csv/migel_de.csv','de')
-> Array
migel> Migel::Util::Importer.new.update('data/csv/migel_fr.csv','fr')
-> Array
migel> Migel::Util::Importer.new.import_all_products_from_csv('migel_product_de.csv', 'de', true)
-> Array

Note

  • No error

Experiment

  • lib/migel/util/importer.rb
  def update_product(migelid, record, lang = 'de')
    lang.downcase!
    product = migelid.products.find{|i| i.pharmacode == record[:pharmacode]} || begin
      p "F0"
      i = Migel::Model::Product.new(record[:pharmacode])
      #sleep 0.01
      p "F2"
      migelid.products.push i
      i
    end
  • lib/migel/model/product.rb
      def initialize(pharmacode)
        @pharmacode = pharmacode
        p "F1"
      end

Log

updating: 10343 / 30742 Estimate total: 27.00 [m] It will be done in: 17.92 [m]
"F0"
"F1"
"F2"
/usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:324: [BUG] Segmentation fault
ruby 1.8.6 (2009-06-08) [x86_64-linux]

Abgebrochen (Speicherabzug geschrieben)

Note

  • The segmentation fault happens after the instance creating

Testcases migel

  1. view
    1. migel/product.rb (coverage: 100%)
    2. migel/items.rb (coverage: 100%)
  2. util
    1. session.rb (coverage: 100%)
    2. oddbapp.rb (coverage: 84.48%)
view · edit · sidebar · attach · print · history
Page last modified on September 26, 2011, at 08:36 AM