Skip to content

Commit

Permalink
chore(test): add go routine to statistics test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienfr committed Jun 1, 2016
1 parent 81edd7c commit 1361db0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## v0.0.1 [Unreleased]
## v0.0.2 [unreleased]
- 16/06/01 chore(test): add go routine to statistics test (SFR)

## v0.0.1 [16/05/31]
- 16/05/25 chore(test): fix tests to run from all OS (SFR/RLE)
- 16/05/19 feat(all): finalize web server, tests and test script (SFR)
feat(web): add web server, middleware and router and get implementation without range
Expand Down
11 changes: 10 additions & 1 deletion utils/statistics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ const (
func TestStatistics(t *testing.T) {

statistics := NewStatistics(2 * statPeriod)
statistics.PlusOne()

// other go routine incrementing the counter
go func() {
statistics.PlusOne()
}()

// other go routine incrementing the counter
go func() {
statistics.PlusOne()
}()

time.Sleep(statPeriod)

Expand Down

0 comments on commit 1361db0

Please sign in to comment.