Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ clean:
rm -f msgvault msgvault.exe mimeshootout
rm -rf bin/

# Run tests. The 20m timeout matches CI's sharded jobs: heavy DuckDB
# packages (cmd, api, query) run concurrently on 2-core CI runners, and the
# per-package wall clock can exceed go test's 10m default under contention.
# Run tests. The CLI package has nearly 1,000 tests, including heavy DuckDB
# coverage, and its per-package wall clock can exceed 20m on contended CI
# runners even when no individual test is stalled.
test:
go test -timeout 20m -tags "$(BUILD_TAGS)" ./...
go test -timeout 30m -tags "$(BUILD_TAGS)" ./...

# Run tests with verbose output
test-v:
go test -timeout 20m -tags "$(BUILD_TAGS)" -v ./...
go test -timeout 30m -tags "$(BUILD_TAGS)" -v ./...

# Run tests against PostgreSQL with the pgvector tag (set MSGVAULT_TEST_DB
# first). Needs a server with the vector extension available.
Expand Down
14 changes: 8 additions & 6 deletions cmd/msgvault/cmd/serve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (
"go.kenn.io/msgvault/internal/testutil/storetest"
)

const serveLifecycleTestTimeout = 30 * time.Second

func TestServeConfigParsing(t *testing.T) {
require := require.New(t)
assert := assert.New(t)
Expand Down Expand Up @@ -203,7 +205,7 @@ func TestRunServeImmediateCancellationWaitsForAPIStart(t *testing.T) {

select {
case <-started:
case <-time.After(5 * time.Second):
case <-time.After(serveLifecycleTestTimeout):
require.FailNow("API startup seam was not entered")
}
cancel()
Expand Down Expand Up @@ -307,7 +309,7 @@ func TestRunServeServesHealthWhileAnalyticsBuildBlocked(t *testing.T) {
case <-buildStarted:
case err := <-errCh:
require.NoError(err, "runServe exited before analytics build was blocked")
case <-time.After(5 * time.Second):
case <-time.After(serveLifecycleTestTimeout):
require.FailNow("analytics cache build did not start")
}
waitForServeHealthBounded(t, c.Server.APIPort, errCh)
Expand Down Expand Up @@ -374,7 +376,7 @@ func TestRunServeDuckDBReportsInitializingWithoutSQLFallback(t *testing.T) {
case <-buildStarted:
case err := <-errCh:
require.NoError(err, "runServe exited before analytics build was blocked")
case <-time.After(5 * time.Second):
case <-time.After(serveLifecycleTestTimeout):
require.FailNow("analytics cache build did not start")
}
waitForServeHealthBounded(t, c.Server.APIPort, errCh)
Expand Down Expand Up @@ -467,7 +469,7 @@ func TestRunServeAutoSwitchesToDuckDBAfterBackgroundBuild(t *testing.T) {
case <-buildStarted:
case err := <-errCh:
require.NoError(err, "runServe exited before analytics build was blocked")
case <-time.After(5 * time.Second):
case <-time.After(serveLifecycleTestTimeout):
require.FailNow("analytics cache build did not start")
}
waitForServeHealthBounded(t, c.Server.APIPort, errCh)
Expand Down Expand Up @@ -610,7 +612,7 @@ func freeTCPPort(t *testing.T) int {
func waitForServeHealth(t *testing.T, port int, errCh <-chan error) {
t.Helper()
url := fmt.Sprintf("http://127.0.0.1:%d/health", port)
deadline := time.Now().Add(5 * time.Second)
deadline := time.Now().Add(serveLifecycleTestTimeout)
for time.Now().Before(deadline) {
select {
case err := <-errCh:
Expand All @@ -634,7 +636,7 @@ func waitForServeHealthBounded(t *testing.T, port int, errCh <-chan error) {
t.Helper()
client := &http.Client{Timeout: 100 * time.Millisecond}
url := fmt.Sprintf("http://127.0.0.1:%d/health", port)
deadline := time.Now().Add(5 * time.Second)
deadline := time.Now().Add(serveLifecycleTestTimeout)
for time.Now().Before(deadline) {
select {
case err := <-errCh:
Expand Down
4 changes: 2 additions & 2 deletions cmd/msgvault/cmd/serve_vector_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestRunServeGivesAnalyticsInitializationGatePriorityOverVector(t *testing.T
case <-analyticsStarted:
case err := <-errCh:
require.NoError(t, err, "runServe exited before analytics initialization")
case <-time.After(5 * time.Second):
case <-time.After(serveLifecycleTestTimeout):
require.FailNow(t, "analytics initialization did not start")
}
waitForServeHealth(t, c.Server.APIPort, errCh)
Expand All @@ -148,7 +148,7 @@ func TestRunServeGivesAnalyticsInitializationGatePriorityOverVector(t *testing.T
case <-vectorStarted:
case err := <-errCh:
require.NoError(t, err, "runServe exited before vector initialization")
case <-time.After(5 * time.Second):
case <-time.After(serveLifecycleTestTimeout):
require.FailNow(t, "vector initialization did not start after analytics released the gate")
}
cancel()
Expand Down
2 changes: 1 addition & 1 deletion nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
sqlite,
}:
let
version = "0.19.2";
version = "0.19.3";
in
buildGoModule {
pname = "msgvault";
Expand Down