Skip to content

chore: fix windows postgres tests #15593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix more tests
  • Loading branch information
hugodutka committed Nov 20, 2024
commit 71e63ef2282aeaa500d693cfea2f7fb6691b38bc
13 changes: 10 additions & 3 deletions enterprise/coderd/workspaceproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http/httptest"
"net/http/httputil"
"net/url"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -168,10 +169,16 @@ func TestRegions(t *testing.T) {
require.Equal(t, proxy.Url, regions[1].PathAppURL)
require.Equal(t, proxy.WildcardHostname, regions[1].WildcardHostname)

waitTime := testutil.WaitShort / 10
// windows needs more time
if runtime.GOOS == "windows" {
waitTime = testutil.WaitShort / 5
}

// Unfortunately need to wait to assert createdAt/updatedAt
<-time.After(testutil.WaitShort / 10)
require.WithinDuration(t, approxCreateTime, proxy.CreatedAt, testutil.WaitShort/10)
require.WithinDuration(t, approxCreateTime, proxy.UpdatedAt, testutil.WaitShort/10)
<-time.After(waitTime)
require.WithinDuration(t, approxCreateTime, proxy.CreatedAt, waitTime)
require.WithinDuration(t, approxCreateTime, proxy.UpdatedAt, waitTime)
})

t.Run("RequireAuth", func(t *testing.T) {
Expand Down
5 changes: 5 additions & 0 deletions enterprise/coderd/workspacequota_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"runtime"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -565,6 +566,10 @@ func TestWorkspaceSerialization(t *testing.T) {
})

t.Run("ActivityBump", func(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Even though this test is expected to 'likely always fail', it doesn't fail on Windows")
}

t.Log("Expected to fail. As long as quota & deadline are on the same " +
" table and affect the same row, this will likely always fail.")
// +---------------------+----------------------------------+
Expand Down