Hello,

   Today I've fixed all my cucumber flaky tests which tested Sphinx
searches.
   Tests didn't run consistently because search daemon didn't always
caught changes in the model.

   Previously, I had the following step to update indexes:

Given 'the Sphinx indexes are updated' do
  # Update all indexes
  ThinkingSphinx::Test.index
  sleep(0.25) # Wait for Sphinx to catch up
end

   To fix the problem, I've changed this to:

Given 'the Sphinx indexes are updated' do
  # Update all indexes
  File.truncate("log/searchd.log", 0)
  ThinkingSphinx::Test.index
  sleep(0.05) while IO.readlines("log/searchd.log").last !~ /rotating
finished/
end

  This change made my tests much more stable.
  Hope this helps to someone :)

  Kind regards,
  KIR


-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to