Fix status table race condition (#1835)

This commit is contained in:
Ethan Koenig authored and Lunny Xiao committed 2017-05-31 16:57:17 +08:00
1 parent 0f5b399e35
commit bfb44f8854
5 files changed
+26 -10

No files matched your search

+9
View File
@@ -18,6 +18,15 @@ func Test_StatusTable(t *testing.T) {
table.Start("xyz")
assert.True(t, table.IsRunning("xyz"))
assert.False(t, table.StartIfNotRunning("xyz"))
assert.True(t, table.IsRunning("xyz"))
table.Stop("xyz")
assert.False(t, table.IsRunning("xyz"))
assert.True(t, table.StartIfNotRunning("xyz"))
assert.True(t, table.IsRunning("xyz"))
table.Stop("xyz")
assert.False(t, table.IsRunning("xyz"))
}