mercredi 3 février 2016

How to test queue worker outage and recovery

I have pretty simple queue system, which works on top of mongodb(findAndModify).

The scenario which I want to test is:

  1. User starts background job and backend puts job into queue.

  2. Worker(nodejs) picks up a job.

  3. After some time worker dies(gracefully or not) and then restarts.

  4. Worker will pick up the job and proceed.

  5. The test condition is pretty simple - job should be done.

Worker is running inside docker container, tests are running outside of it. Is there any good way how to test this behavior?

Aucun commentaire:

Enregistrer un commentaire