Skip to content

Commit

Permalink
throw error for failed use space execution (#63)
Browse files Browse the repository at this point in the history
* throw error for failed use space execution

* upload logs

* add sleep after create schema
  • Loading branch information
Nicole00 authored Oct 24, 2022
1 parent 1091639 commit 44015bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ class GraphProvider(addresses: List[Address],
val switchStatment = s"use $space"
LOG.info(s"switch space $space")
val result = submit(switchStatment)
result.isSucceeded
if(!result.isSucceeded){
LOG.error(s"switch space $space failed, ${result.getErrorMessage}")
throw new RuntimeException(s"switch space $space failed, ${result.getErrorMessage}")
}
true
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GraphProviderTest extends AnyFunSuite with BeforeAndAfterAll {
}

test("switchSpace") {
assert(!graphProvider.switchSpace("root", "nebula", "not_exit_space"))
assertThrows[RuntimeException](graphProvider.switchSpace("root", "nebula", "space_not_exist"))
assert(graphProvider.switchSpace("root", "nebula", "test_int"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class WriteDeleteSuite extends AnyFunSuite with BeforeAndAfterAll {
graphMock.mockStringIdGraphSchema()
graphMock.mockIntIdGraphSchema()
graphMock.close()
Thread.sleep(10000)
SparkMock.writeVertex()
SparkMock.writeEdge()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class WriteInsertSuite extends AnyFunSuite with BeforeAndAfterAll {
graphMock.mockStringIdGraphSchema()
graphMock.mockIntIdGraphSchema()
graphMock.close()
Thread.sleep(10000)
}

test("write vertex into test_write_string space with insert mode") {
Expand Down

0 comments on commit 44015bb

Please sign in to comment.