I have a go program that establishes a connection to and queries a Postgres database. I would like to test multiple processes accessing a database at the same time, similar to how it will be deployed and similar to how is done in this article:
Answer is very simple – it breaks when I'll run it many times in parallel. How? Let's see:
psql -c 'truncate test'; for i in {1..10}; do ./test.pl & done; sleep 5; killall perl`
I've read through the documentation on psql -c
but I'm still unclear as to how the command works. I'm unsure what language that accepts. My guess is perl, judging by the killall
command and my very basic understanding of the language.
How could one accomplish this for a go program?
Aucun commentaire:
Enregistrer un commentaire