![]() | Chapter 9 Asynchronous ATM example |
|
06 Mar 2013, 09:36
Steven Jing (4 posts) |
when running the atm program even with the “eventually” method is applied, I still got a flicking result when running it repeatedly with command ruby -e “30.times {system ‘cucumber -f progress’}” And I find sometimes the program will get into below result. Within a scenario And this problem doesn’t seem to be the race between processor and cucumber. It’s weird And this is the only case it will get into, and all the rest runs are passed. |
|
06 Mar 2013, 09:47
Steven Jing (4 posts) |
below is part of relevant code. I’m wondering if it is because that while it’s creating the 1st transaction file, before 100 writing is completed, the processor come to read the queue and find the file indeed exits, but just read 0, and then delete the file so that we got a “0” & “-20” result class TransactionQueue def self.clear FileUtils.rm_rf(‘messages’) FileUtils.mkdir_p(‘messages’) end
|
| You must be logged in to comment |

