Skip to content
  1. Jul 24, 2015
  2. Jul 15, 2015
  3. Jul 14, 2015
  4. Jul 03, 2015
  5. Jun 24, 2015
  6. Jun 23, 2015
  7. Jun 13, 2015
  8. Jun 08, 2015
  9. Jun 07, 2015
  10. May 31, 2015
  11. May 26, 2015
  12. May 21, 2015
  13. May 19, 2015
  14. May 14, 2015
    • Mike Bland's avatar
      Remove file watch upon interruption · 020a35e8
      Mike Bland authored
      TestValidatorOverwriteEmailListViaRenameAndReplace was deadlocking on
      Windows because, on Windows, fsnotify.Watcher will continue to watch a
      renamed file using its new name. On other systems, it appears the watch on
      a file is removed after a rename.
      
      The fix is to explicitly remove the watch to ensure the watch is resumed
      under the original name.
      020a35e8
    • Mike Bland's avatar
      Ensure watcher tests don't block during shutdown · 5f2df716
      Mike Bland authored
      These test failures from #93 inspired this change:
      https://travis-ci.org/bitly/google_auth_proxy/jobs/62474406
      https://travis-ci.org/bitly/google_auth_proxy/jobs/62474407
      
      Both tests exhibited this pattern:
      2015/05/13 22:10:54 validating: is xyzzy@example.com valid? false
      2015/05/13 22:10:54 watching interrupted on event: "/tmp/test_auth_emails_300880185": CHMOD
      2015/05/13 22:10:54 watching resumed for /tmp/test_auth_emails_300880185
      2015/05/13 22:10:54 reloading after event: "/tmp/test_auth_emails_300880185": CHMOD
      panic: test timed out after 1m0s
      
      [snip]
      
      goroutine 175 [chan send]:
      github.com/bitly/google_auth_proxy.(*ValidatorTest).TearDown(0xc2080bc330)
              /home/travis/gopath/src/github.com/bitly/google_auth_proxy/validator_test.go:27 +0x43
      github.com/bitly/google_auth_proxy.TestValidatorOverwriteEmailListViaRenameAndReplace(0xc2080f2480)
              /home/travis/gopath/src/github.com/bitly/google_auth_proxy/validator_watcher_test.go:103 +0x3b9
      
      [snip]
      
      goroutine 177 [chan send]:
      github.com/bitly/google_auth_proxy.func·017()
              /home/travis/gopath/src/github.com/bitly/google_auth_proxy/validator_test.go:34 +0x41
      
      I realized that the spurious CHMOD events were causing calls to
      `func() { updated <- true }` (from validator_test.go:34), which caused
      the goroutine running the watcher to block. At the same time,
      ValidatorTest.TearDown was blocked by trying to send into the `done` channel.
      The solution was to create a flag that ensured only one value was ever sent
      into the update channel.
      5f2df716