mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
* fix: Synchronize peer logging with a channel We were depending on the close mutex to properly report connection state. This ensures the RTC connection is properly closed before returning. * Disable pion logging * Remove buffer * Try ICE servers * Remove flushed * Add diagram explaining handshake * Fix candidate accept ordering * Add debug logging to peerbroker * Fix send ordering * Lock adding ICE candidate * Add test for negotiating out of order * Reduce connection to a single negotiation channel * Improve test times by pre-installing Terraform * Lock remote session description being applied * Organize conn * Revert to multi-channel setup * Properly close ICE gatherer * Improve comments * Try removing buffered candidates * Buffer local and remote messages * Log dTLS transport state * Add pion logging
39 lines
599 B
Go
39 lines
599 B
Go
//go:build linux
|
|
|
|
package postgres_test
|
|
|
|
import (
|
|
"database/sql"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"go.uber.org/goleak"
|
|
|
|
"github.com/coder/coder/database/postgres"
|
|
|
|
_ "github.com/lib/pq"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
goleak.VerifyTestMain(m)
|
|
}
|
|
|
|
func TestPostgres(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
if testing.Short() {
|
|
t.Skip()
|
|
return
|
|
}
|
|
|
|
connect, close, err := postgres.Open()
|
|
require.NoError(t, err)
|
|
defer close()
|
|
db, err := sql.Open("postgres", connect)
|
|
require.NoError(t, err)
|
|
err = db.Ping()
|
|
require.NoError(t, err)
|
|
err = db.Close()
|
|
require.NoError(t, err)
|
|
}
|