<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>concurrency on Arrans Technical blog</title><link>https://arran4.github.io/blog/tags/concurrency/</link><description>Recent content in concurrency on Arrans Technical blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>technicalblog123@arran4.com (Arran Ubels)</managingEditor><webMaster>technicalblog123@arran4.com (Arran Ubels)</webMaster><copyright>Arran Ubels. This work is licensed under a &lt;a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License&lt;/a>.</copyright><lastBuildDate>Fri, 02 Oct 2026 11:55:00 +1000</lastBuildDate><atom:link href="https://arran4.github.io/blog/tags/concurrency/index.xml" rel="self" type="application/rss+xml"/><item><title>Go Tests: Treat Process State, Time, and Standard I/O as Dependencies</title><link>https://arran4.github.io/blog/post/2026/053-go-tests-treat-process-state-time-and-standard-io-as-dependencies/</link><pubDate>Fri, 02 Oct 2026 11:55:00 +1000</pubDate><author>technicalblog123@arran4.com (Arran Ubels)</author><guid>https://arran4.github.io/blog/post/2026/053-go-tests-treat-process-state-time-and-standard-io-as-dependencies/</guid><description>Filesystem access is only one form of hidden test dependency. The same problem appears when a unit test temporarily replaces process-wide state:
1old := os.Stdout 2os.Stdout = w 3defer func() { os.Stdout = old }() or:
1oldURL := APIURL 2APIURL = server.URL 3defer func() { APIURL = oldURL }() or:
1oldTimeout := defaultTimeout 2defaultTimeout = 10 * time.Millisecond 3defer func() { defaultTimeout = oldTimeout }() These tests can work, but they make otherwise local behaviour depend on global mutable state.</description></item></channel></rss>