Skip to content

Commit

Permalink
fix unit_race failures
Browse files Browse the repository at this point in the history
Signed-off-by: deepthi <deepthi@planetscale.com>
  • Loading branch information
deepthi committed Sep 13, 2019
1 parent cf020fb commit 91e4977
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions go/mysql/fakesqldb/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,8 @@ func (db *DB) ConnectionClosed(c *mysql.Conn) {
db.mu.Lock()
defer db.mu.Unlock()

if db.t != nil {
db.t.Logf("ConnectionClosed(%v): client %v", db.name, c.ConnectionID)
}

if _, ok := db.connections[c.ConnectionID]; !ok {
db.t.Fatalf("BUG: Cannot delete connection from list of open connections because it is not registered. ID: %v Conn: %v", c.ConnectionID, c)
panic(fmt.Errorf("BUG: Cannot delete connection from list of open connections because it is not registered. ID: %v Conn: %v", c.ConnectionID, c))
}
delete(db.connections, c.ConnectionID)
}
Expand Down

0 comments on commit 91e4977

Please sign in to comment.