yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] test/helper: warn atomically
@ 2015-06-15 19:22 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-06-15 19:22 UTC (permalink / raw)
  To: yahns-public

We want to avoid race conditions if tests become multithreaded
from Kernel#warn internally issuing a second write.
---
 test/helper.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/helper.rb b/test/helper.rb
index 7b8c1aa..c86f3e3 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -140,7 +140,7 @@ class DieIfUsed
   end
 
   def close
-    warn "INFO #$$ closed DieIfUsed #{@@n += 1}"
+    warn "INFO #$$ closed DieIfUsed #{@@n += 1}\n"
   end
 end
 
-- 
EW


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-15 19:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 19:22 [PATCH] test/helper: warn atomically Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../yahns.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).