Skip to content

Commit

Permalink
workflows: Use larger machine shape for test suite
Browse files Browse the repository at this point in the history
This change uses an 8-core machine with more memory for running the unit tests.
Several tests which were not marked as `t.Parallel()` due to resource
constraints are allowed to run in parallel.
  • Loading branch information
bobvawter committed Nov 2, 2023
1 parent de0f655 commit 003b140
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
# Integration matrix tests for all supported CRDB and source DBs.
tests:
name: Integration Tests
runs-on: ${{ matrix.runs-on || 'ubuntu-latest' }}
runs-on: ${{ matrix.runs-on || 'ubuntu-latest-8-core' }}
strategy:
fail-fast: false
# Refer to the CRDB support policy when determining how many
Expand Down Expand Up @@ -118,8 +118,6 @@ jobs:
# target: oracle-v18.4
# targetConn: "oracle://system:SoupOrSecret@127.0.0.1:1521/XEPDB1"
- cockroachdb: v23.1
# Managed by dev-inf team.
runs-on: ubuntu-latest-8-core
target: oracle-v21.3
targetConn: "oracle://system:SoupOrSecret@127.0.0.1:1521/XEPDB1"

Expand Down
2 changes: 2 additions & 0 deletions internal/source/cdc/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func createFixture(
}

func testQueryHandler(t *testing.T, htc *fixtureConfig) {
t.Parallel()
t.Helper()
fixture, tableInfo := createFixture(t, htc)
ctx := fixture.Context
Expand Down Expand Up @@ -299,6 +300,7 @@ func testQueryHandler(t *testing.T, htc *fixtureConfig) {
}

func testHandler(t *testing.T, cfg *fixtureConfig) {
t.Parallel()
t.Helper()
fixture, tableInfo := createFixture(t, cfg)
ctx := fixture.Context
Expand Down
1 change: 1 addition & 0 deletions internal/source/server/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func TestIntegration(t *testing.T) {
}

func testIntegration(t *testing.T, cfg testConfig) {
t.Parallel()
a := assert.New(t)
r := require.New(t)

Expand Down
2 changes: 2 additions & 0 deletions internal/target/apply/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,9 @@ func TestAllDataTypes(t *testing.T) {
}

for _, tc := range testcases {
tc := tc // Capture for t.Parallel().
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
r := require.New(t)

// Creating a new database for each loop is, as of v22.2 and
Expand Down
5 changes: 5 additions & 0 deletions internal/target/schemawatch/coldata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ func TestGetColumns(t *testing.T) {

for i, test := range testcases {
t.Run(fmt.Sprintf("%d:%s", i, test.tableSchema), func(t *testing.T) {
// This test can't be marked as paralell until the test
// cases above are able to take a *Fixture as input.
// Otherwise, concurrent tests would clash on tables defined
// in the same schema, leading to a race condition.

if test.skip {
t.Skip("not applicable")
}
Expand Down

0 comments on commit 003b140

Please sign in to comment.