Skip to content

Commit

Permalink
Adding index wait command for test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Truscott committed Sep 30, 2015
1 parent 2331db0 commit 9184d42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func Test_IndexPresent_Simple_Create(t *testing.T) {
}
err = client.IndexPresent(table, index)
expect(t, err, nil)
r.Table(table.Name).IndexWait().Exec(session)

indices, _ := client.TableIndexList(table)
expect(t, stringInSlice(index.Name, indices), true)
Expand Down Expand Up @@ -46,7 +47,6 @@ func Test_IndexPresent_Simple_IndexListFail(t *testing.T) {
refute(t, err, nil)
}


func Test_IndexPresent_Simple_CreateFail(t *testing.T) {
table := Table{Name: "Test_IndexPresent"}
err := client.TablePresent(table)
Expand All @@ -73,11 +73,11 @@ func Test_IndexPresent_Compound_Create(t *testing.T) {
}
err = client.IndexPresent(table, index)
expect(t, err, nil)
r.Table(table.Name).IndexWait().Exec(session)

indices, _ := client.TableIndexList(table)
expect(t, stringInSlice(index.Name, indices), true)


// Do an insert and find
obj := map[string]string{"user_id": "12345", "flavor": "vanilla"}
_, err = r.Table(table.Name).Insert(obj).RunWrite(session)
Expand Down Expand Up @@ -139,6 +139,7 @@ func Test_IndexAbsent_Success(t *testing.T) {
index := Index{Name: "Test_IndexAbsent_Success"}
err = client.IndexPresent(table, index)
expect(t, err, nil)
r.Table(table.Name).IndexWait().Exec(session)

indices, _ := client.TableIndexList(table)
expect(t, stringInSlice(index.Name, indices), true)
Expand Down Expand Up @@ -182,7 +183,6 @@ func Test_IndexAbsent_Already_Absent(t *testing.T) {
indices, _ := client.TableIndexList(table)
expect(t, stringInSlice(index.Name, indices), true)


err = client.IndexAbsent(table, index)
expect(t, err, nil)

Expand Down

0 comments on commit 9184d42

Please sign in to comment.