From deaa95444be6567e33a58915681f8ecf090a6ad8 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Fri, 2 May 2014 19:06:14 -0400 Subject: [PATCH] wait for the server to sync --- src/integration/single_server_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/integration/single_server_test.go b/src/integration/single_server_test.go index 57e02f4f11..2b61b1d399 100644 --- a/src/integration/single_server_test.go +++ b/src/integration/single_server_test.go @@ -184,15 +184,18 @@ func (self *SingleServerSuite) TestUserWritePermissions(c *C) { rootUser.ChangeDatabaseUser("db1", "limited_user", "pass", false, "^$", "test_should_write") // write the data to test the write permissions c.Assert(user.WriteSeries(series), IsNil) + self.server.WaitForServerToSync() invalidSeries := []*influxdb.Series{} content = self.server.RunQueryAsRoot("select * from test_should_write", "m", c) c.Assert(content, HasLen, 1) c.Assert(json.Unmarshal([]byte(invalidData), &invalidSeries), IsNil) c.Assert(user.WriteSeries(invalidSeries), NotNil) + self.server.WaitForServerToSync() content = self.server.RunQueryAsRoot("select * from test_should_not_write", "m", c) c.Assert(content, HasLen, 0) rootUser.ChangeDatabaseUser("db1", "limited_user", "pass", false, "^$", "test_.*") c.Assert(user.WriteSeries(invalidSeries), IsNil) + self.server.WaitForServerToSync() content = self.server.RunQueryAsRoot("select * from test_should_not_write", "m", c) c.Assert(content, HasLen, 1) } @@ -222,6 +225,7 @@ func (self *SingleServerSuite) TestUserReadPermissions(c *C) { } ]` self.server.WriteData(data, c) + self.server.WaitForServerToSync() // test all three cases, read from one series that the user has read access to, one that the user doesn't have // access to and a regex