Skip to content

LOADTEST: Shared desired state CTE for Apple profile reconciler#45572

Draft
MagnusHJensen wants to merge 4 commits into
mainfrom
claude/optimize-reconciler-queries-edCDn
Draft

LOADTEST: Shared desired state CTE for Apple profile reconciler#45572
MagnusHJensen wants to merge 4 commits into
mainfrom
claude/optimize-reconciler-queries-edCDn

Conversation

@MagnusHJensen
Copy link
Copy Markdown
Member

ListMDMAppleProfilesToInstallAndRemove used to run the install and remove queries back-to-back inside a single read transaction. The desired-state subquery (a 4-way UNION over mdm_apple_configuration_profiles × hosts × nano_enrollments × nano_devices, plus label-membership joins) is the dominant cost on every tick of the mdm_apple_profile_manager cron, and was being evaluated twice per pass.

Fold both halves into one statement that lifts the desired state into a CTE referenced by an install LEFT JOIN and a remove RIGHT JOIN with their respective WHERE shapes preserved, discriminated by a literal op column. Add a NO_MERGE optimizer hint on each SELECT in the UNION so MySQL 8 materializes the CTE once instead of inlining it per reference.

No behavior change: the per-half SELECT lists and WHERE clauses match the originals, and the existing matchCombinedProfiles assertion in testMDMAppleProfileManagement compares the combined result against the legacy two-query path for every covered case.

… reconciler

ListMDMAppleProfilesToInstallAndRemove used to run the install and
remove queries back-to-back inside a single read transaction. The
desired-state subquery (a 4-way UNION over mdm_apple_configuration_profiles
× hosts × nano_enrollments × nano_devices, plus label-membership joins)
is the dominant cost on every tick of the mdm_apple_profile_manager
cron, and was being evaluated twice per pass.

Fold both halves into one statement that lifts the desired state into
a CTE referenced by an install LEFT JOIN and a remove RIGHT JOIN with
their respective WHERE shapes preserved, discriminated by a literal
`op` column. Add a NO_MERGE optimizer hint on each SELECT in the UNION
so MySQL 8 materializes the CTE once instead of inlining it per
reference.

No behavior change: the per-half SELECT lists and WHERE clauses match
the originals, and the existing matchCombinedProfiles assertion in
testMDMAppleProfileManagement compares the combined result against the
legacy two-query path for every covered case.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 98.89807% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.75%. Comparing base (4f8737e) to head (51ea920).
⚠️ Report is 60 commits behind head on main.

Files with missing lines Patch % Lines
server/datastore/mysql/apple_mdm.go 98.89% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #45572      +/-   ##
==========================================
+ Coverage   66.71%   66.75%   +0.04%     
==========================================
  Files        2734     2740       +6     
  Lines      218824   219464     +640     
  Branches    10947    10947              
==========================================
+ Hits       145979   146508     +529     
- Misses      59626    59743     +117     
+ Partials    13219    13213       -6     
Flag Coverage Δ
backend 68.60% <98.89%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Test renders the combined Apple profile reconciler SQL with literals
substituted for placeholders and writes it to disk, so it can be
pasted into a MySQL shell after EXPLAIN ANALYZE without needing to
hand-assemble the query from generateDesiredStateQuery's template.

Runs without a database (string formatting only). Output path
defaults to /tmp/reconciler_query.sql; override with
DUMP_RECONCILER_QUERY_PATH.
The label-based branches of generateDesiredStateQuery (include-all,
exclude-any, include-any) used to express their predicates as
LEFT JOIN ... GROUP BY ... HAVING count_*. On reconciler-scale fleets
that built large aggregation temp tables — branches 3 and 4 alone
accounted for ~17 of the ~22 seconds spent materializing the
desired-state CTE per cron tick.

Each predicate is straightforwardly expressible with EXISTS / NOT
EXISTS:

  - include-all: NOT EXISTS a label the host misses (covers both
    "broken label" and "host not a member" via the LEFT JOIN's
    NULL semantics).
  - exclude-any: NOT EXISTS a label that's broken, that the host
    is in, or whose results the host hasn't reported yet.
  - include-any: EXISTS a label_membership row joining one of the
    profile's include-any labels to the host.

EXPLAIN ANALYZE on a representative dataset (288K desired-state
rows, 343K host_mdm_apple_profiles rows) drops the combined
reconciler query from ~32s to ~21.7s — a ~32% reduction, driven
mostly by branches 3 (7.6s → 4.6s) and 4 (9.6s → 7.4s) no longer
building Aggregate-using-temporary-table nodes. The CTE's
column shape is preserved; the count_* fields are now constant
placeholders since no caller of generateDesiredStateQuery ever
reads them.

Declarations share the same template via dynamicNames, so they
get the same rewrite for free.
Adds a second variant of the desired-state UNION
(generateReconcilerDesiredStateQuery) used only by the cron's combined
install+remove query, with two changes to branches 3 and 4:

  - Branch 4 (include-any) uses SELECT STRAIGHT_JOIN to invert the join
    order. Today's plan starts from the include-any mel rows (~42) but
    fans hosts out per profile via fk_hosts_team_id (319K rows on the
    test dataset) and probes label_membership last with ~3.6% selectivity.
    Driving instead from mdm_configuration_profile_labels through
    label_membership via idx_lm_label_id (~21K rows) and then resolving
    mae / hosts / nano_enrollments / nano_devices via PK lookups cut
    branch 4 from ~7.4s to ~390ms on the load-test dataset.

  - Branch 3 (exclude-any) splits the original single NOT EXISTS
    antijoin into two pieces: a hash antijoin against a new
    excluded_in_label_pairs CTE (materialized once at the top of the
    cron statement, ~20K rows on the test dataset) that captures the
    dominant "host is in some label" disqualifier in O(1) hash probes,
    plus a smaller per-row NOT EXISTS that only inspects mel/lbl for
    the rarer broken-label and stale-label-results cases. Branch 3
    drops from ~5.1s to ~4.8s; total query 21.7s → ~13.5s end-to-end.

Per-host callers of generateDesiredStateQuery (worker, orbit, bulkSet
writer path) operate on bounded inputs where the CTE materialization
overhead would not pay back, so they continue to use the unchanged
generateDesiredStateQuery. Only the cron's full-scan path routes
through the new variant.

Removes the throwaway TestDumpReconcilerQuery helper that was added to
serialize the cron query for EXPLAIN ANALYZE iteration. It was useful
during the optimization passes; not needed in the committed tree.
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: test-go (fleetctl, mysql:8.0.44) / test

Failed stage: Run Go Tests [❌]

Failed test name: TestIntegrationsVulnerabilityDataStream

Failure summary:

The action failed because a Go integration test failed during make test-go:
- Failed test:
cmd/fleetctl/integrationtest/vuln TestIntegrationsVulnerabilityDataStream (shown at log line 2108).

- Failure location: cmd/fleetctl/integrationtest/vuln/vulnerability_data_stream_test.go:44 (log
lines 2110-2114).
- Root cause: the test attempted to download OSV artifacts but GitHub returned an
HTTP 403 while fetching the latest release (Error downloading OSV artifacts: getting latest release:
github http status error: 403).
- This caused gotestsum to report DONE 846 tests, 1 failure, and
make exited non-zero (Makefile:280: .run-go-tests), failing the job with exit code 2.

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

944:  �[36;1mattempt=1�[0m
945:  �[36;1m�[0m
946:  �[36;1mwhile [ $attempt -le $max_attempts ]; do�[0m
947:  �[36;1m  echo "Attempt $attempt of $max_attempts"�[0m
948:  �[36;1m�[0m
949:  �[36;1m  # Try to connect to MySQL�[0m
950:  �[36;1m  if wait_for_mysql "mysql_test"; then�[0m
951:  �[36;1m    # If MySQL is ready, try to connect to MySQL replica�[0m
952:  �[36;1m    if wait_for_mysql "mysql_replica_test"; then�[0m
953:  �[36;1m      # Both are ready, we're done�[0m
954:  �[36;1m      echo "All MySQL connections successful"�[0m
955:  �[36;1m      exit 0�[0m
956:  �[36;1m    fi�[0m
957:  �[36;1m  fi�[0m
958:  �[36;1m�[0m
959:  �[36;1m  # If we get here, at least one connection failed�[0m
960:  �[36;1m  echo "Failed to connect to MySQL on attempt $attempt"�[0m
961:  �[36;1m�[0m
962:  �[36;1m  if [ $attempt -lt $max_attempts ]; then�[0m
963:  �[36;1m    echo "Restarting containers and trying again..."�[0m
964:  �[36;1m    restart_containers�[0m
965:  �[36;1m  else�[0m
966:  �[36;1m    echo "Maximum attempts reached. Failing the job."�[0m
967:  �[36;1m    exit 1�[0m
...

1243:  make[1]: Entering directory '/home/runner/work/fleet/fleet'
1244:  Running Go tests with gotestsum:
1245:  gotestsum --format=testdox --jsonfile=/tmp/test-output.json -- -tags full,fts5,netgo -run=  -v -race=false -timeout=20m  -parallel 8 -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/fleetdm/fleet/v4/... ././cmd/fleetctl/... 
1246:  go: downloading github.com/AbGuthrie/goquery/v2 v2.0.1
1247:  go: downloading github.com/tj/assert v0.0.3
1248:  go: downloading github.com/hashicorp/golang-lru v0.5.4
1249:  go: downloading github.com/stretchr/objx v0.5.2
1250:  go: downloading github.com/c-bata/go-prompt v0.2.3
1251:  go: downloading github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942
1252:  github.com/fleetdm/fleet/v4/cmd/fleetctl:
1253:  github.com/fleetdm/fleet/v4/cmd/fleetctl/fleetctl/goquerycmd:
1254:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest:
1255:  github.com/fleetdm/fleet/v4/cmd/fleetctl/fleetctl/testing_utils:
1256:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/preview:
1257:  �[32m✓�[0m Integrations preview (48.44s)
1258:  �[32m✓�[0m Preview fails on invalid license key (0.00s)
1259:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/vuln:
...

1370:  �[32m✓�[0m Apply specs deprecated keys app config windows updates.grace period days not a number (0.54s)
1371:  �[32m✓�[0m Apply specs deprecated keys app config windows updates.grace period days out of range (0.51s)
1372:  �[32m✓�[0m Apply specs deprecated keys config with FIM values for agent options (#869 9) (0.38s)
1373:  �[32m✓�[0m Apply specs deprecated keys config with blank required org name (0.42s)
1374:  �[32m✓�[0m Apply specs deprecated keys config with blank required server url (0.49s)
1375:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options command-line flags (0.57s)
1376:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options data type in dry-run (0.52s)
1377:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options data type with force (0.46s)
1378:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options in dry-run (0.50s)
1379:  �[32m✓�[0m Apply specs deprecated keys config with invalid key type (0.41s)
1380:  �[32m✓�[0m Apply specs deprecated keys config with invalid value for agent options command-line flags (0.70s)
1381:  �[32m✓�[0m Apply specs deprecated keys config with unknown key (0.56s)
1382:  �[32m✓�[0m Apply specs deprecated keys config with valid agent options command-line flags (0.45s)
1383:  �[32m✓�[0m Apply specs deprecated keys dry-run set with unsupported spec (0.53s)
1384:  �[32m✓�[0m Apply specs deprecated keys dry-run set with various specs, appconfig warning for legacy (0.40s)
1385:  �[32m✓�[0m Apply specs deprecated keys dry-run set with various specs, no errors (0.45s)
1386:  �[32m✓�[0m Apply specs deprecated keys empty config (0.48s)
...

1389:  �[32m✓�[0m Apply specs deprecated keys invalid agent options dry-run (0.40s)
1390:  �[32m✓�[0m Apply specs deprecated keys invalid agent options field type (0.41s)
1391:  �[32m✓�[0m Apply specs deprecated keys invalid agent options field type in overrides (0.38s)
1392:  �[32m✓�[0m Apply specs deprecated keys invalid agent options for existing team (0.48s)
1393:  �[32m✓�[0m Apply specs deprecated keys invalid agent options for new team (0.46s)
1394:  �[32m✓�[0m Apply specs deprecated keys invalid agent options force (0.47s)
1395:  �[32m✓�[0m Apply specs deprecated keys invalid known key's value type for team cannot be forced (0.49s)
1396:  �[32m✓�[0m Apply specs deprecated keys invalid team agent options command-line flag (0.42s)
1397:  �[32m✓�[0m Apply specs deprecated keys invalid top-level key for team (0.47s)
1398:  �[32m✓�[0m Apply specs deprecated keys macos updates deadline set but minimum version empty (0.47s)
1399:  �[32m✓�[0m Apply specs deprecated keys macos updates minimum version set but deadline empty (0.37s)
1400:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with incomplete date (0.38s)
1401:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with invalid date (0.46s)
1402:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with timestamp (0.50s)
1403:  �[32m✓�[0m Apply specs deprecated keys macos updates.minimum version with build version (0.35s)
1404:  �[32m✓�[0m Apply specs deprecated keys missing required failing policies destination url (0.53s)
1405:  �[32m✓�[0m Apply specs deprecated keys missing required host status days count (0.39s)
...

1413:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption true (0.58s)
1414:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption with invalid value type (0.67s)
1415:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption without a value (0.54s)
1416:  �[32m✓�[0m Apply specs deprecated keys unknown key for team can be forced (0.42s)
1417:  �[32m✓�[0m Apply specs deprecated keys valid team agent options command-line flag (0.45s)
1418:  �[32m✓�[0m Apply specs deprecated keys windows updates unset valid (0.50s)
1419:  �[32m✓�[0m Apply specs deprecated keys windows updates valid (0.52s)
1420:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days but grace period empty (0.39s)
1421:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days not a number (0.51s)
1422:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days out of range (0.43s)
1423:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days but deadline empty (0.46s)
1424:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days not a number (0.47s)
1425:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days out of range (0.41s)
1426:  �[32m✓�[0m Apply specs dry-run set with unsupported spec (0.53s)
1427:  �[32m✓�[0m Apply specs dry-run set with various specs, appconfig warning for legacy (0.36s)
1428:  �[32m✓�[0m Apply specs dry-run set with various specs, no errors (0.49s)
1429:  �[32m✓�[0m Apply specs empty config (0.39s)
...

1432:  �[32m✓�[0m Apply specs invalid agent options dry-run (0.48s)
1433:  �[32m✓�[0m Apply specs invalid agent options field type (0.46s)
1434:  �[32m✓�[0m Apply specs invalid agent options field type in overrides (0.57s)
1435:  �[32m✓�[0m Apply specs invalid agent options for existing team (0.41s)
1436:  �[32m✓�[0m Apply specs invalid agent options for new team (0.33s)
1437:  �[32m✓�[0m Apply specs invalid agent options force (0.39s)
1438:  �[32m✓�[0m Apply specs invalid known key's value type for team cannot be forced (0.46s)
1439:  �[32m✓�[0m Apply specs invalid team agent options command-line flag (0.42s)
1440:  �[32m✓�[0m Apply specs invalid top-level key for team (0.44s)
1441:  �[32m✓�[0m Apply specs macos updates deadline set but minimum version empty (0.39s)
1442:  �[32m✓�[0m Apply specs macos updates minimum version set but deadline empty (0.45s)
1443:  �[32m✓�[0m Apply specs macos updates.deadline with incomplete date (0.37s)
1444:  �[32m✓�[0m Apply specs macos updates.deadline with invalid date (0.39s)
1445:  �[32m✓�[0m Apply specs macos updates.deadline with timestamp (0.53s)
1446:  �[32m✓�[0m Apply specs macos updates.minimum version with build version (0.41s)
1447:  �[32m✓�[0m Apply specs missing required failing policies destination url (0.33s)
1448:  �[32m✓�[0m Apply specs missing required host status days count (0.49s)
...

1467:  �[32m✓�[0m Apply specs windows updates.grace period days not a number (0.50s)
1468:  �[32m✓�[0m Apply specs windows updates.grace period days out of range (0.38s)
1469:  �[32m✓�[0m Apply team specs (0.48s)
1470:  �[32m✓�[0m Apply user roles (0.50s)
1471:  �[32m✓�[0m Apply user roles deprecated (0.37s)
1472:  �[32m✓�[0m Apply windows updates (0.53s)
1473:  �[32m✓�[0m Apply windows updates field omitted (0.00s)
1474:  �[32m✓�[0m Apply windows updates with null values (0.00s)
1475:  �[32m✓�[0m Apply windows updates with values (0.00s)
1476:  �[32m✓�[0m Can apply intervals in nanoseconds (0.39s)
1477:  �[32m✓�[0m Can apply intervals using durations (0.34s)
1478:  �[32m✓�[0m Clean status code err (0.00s)
1479:  �[32m✓�[0m Clean status code err bare wrapped status code err (0.00s)
1480:  �[32m✓�[0m Clean status code err nil (0.00s)
1481:  �[32m✓�[0m Clean status code err outer-wrapped status code err (0.00s)
1482:  �[32m✓�[0m Clean status code err plain error untouched (0.00s)
1483:  �[32m✓�[0m Compute label changes (0.00s)
...

1539:  �[32m✓�[0m Filename functions (0.00s)
1540:  �[32m✓�[0m Filename functions outfile name builds a file name using the name provided + current time (0.00s)
1541:  �[32m✓�[0m Filename functions outfile name with ext builds a file name using the name and extension provided + current time (0.00s)
1542:  �[32m✓�[0m FleetctlUpgradePacks empty packs (0.36s)
1543:  �[32m✓�[0m FleetctlUpgradePacks no pack (0.49s)
1544:  �[32m✓�[0m FleetctlUpgradePacks non empty (0.43s)
1545:  �[32m✓�[0m FleetctlUpgradePacks not admin (0.56s)
1546:  �[32m✓�[0m Format XML (0.00s)
1547:  �[32m✓�[0m Format XML XML with attributes (0.00s)
1548:  �[32m✓�[0m Format XML basic XML (0.00s)
1549:  �[32m✓�[0m Format XML empty XML (0.00s)
1550:  �[32m✓�[0m Format XML invalid XML (0.00s)
1551:  �[32m✓�[0m Format XML nested XML (0.00s)
1552:  �[32m✓�[0m Generate MDM apple (0.73s)
1553:  �[32m✓�[0m Generate MDM apple BM (0.37s)
1554:  �[32m✓�[0m Generate MDM apple CSR API call fails (0.37s)
1555:  �[32m✓�[0m Generate MDM apple successful run (0.36s)
1556:  �[32m✓�[0m Generate MDMVPP tokens (0.00s)
1557:  �[32m✓�[0m Generate MDMVPP tokens get VPP tokens error (0.00s)
1558:  �[32m✓�[0m Generate MDMVPP tokens multiple tokens with different teams (0.00s)
...

1574:  �[32m✓�[0m Generate org settings insecure (0.00s)
1575:  �[32m✓�[0m Generate org settings masked google calendar api key (0.00s)
1576:  �[32m✓�[0m Generate policies (0.00s)
1577:  �[32m✓�[0m Generate queries (0.00s)
1578:  �[32m✓�[0m Generate software (0.00s)
1579:  �[32m✓�[0m Generate software auto update schedule (0.00s)
1580:  �[32m✓�[0m Generate software script packages (0.00s)
1581:  �[32m✓�[0m Generate team settings (0.00s)
1582:  �[32m✓�[0m Generate team settings insecure (0.00s)
1583:  �[32m✓�[0m Generated org settings no SSO (0.00s)
1584:  �[32m✓�[0m Generated org settings okta conditional access not included (0.00s)
1585:  �[32m✓�[0m Get MDM command results (0.48s)
1586:  �[32m✓�[0m Get MDM command results command flag required (0.00s)
1587:  �[32m✓�[0m Get MDM command results command not found (0.01s)
1588:  �[32m✓�[0m Get MDM command results command results empty (0.01s)
1589:  �[32m✓�[0m Get MDM command results command results error (0.01s)
1590:  �[32m✓�[0m Get MDM command results darwin command results (0.00s)
1591:  �[32m✓�[0m Get MDM command results host specific results (0.00s)
1592:  �[32m✓�[0m Get MDM command results windows command results (0.00s)
1593:  �[32m✓�[0m Get MDM commands (0.40s)
1594:  �[32m✓�[0m Get apple BM (1.85s)
1595:  �[32m✓�[0m Get apple BM free license (0.43s)
1596:  �[32m✓�[0m Get apple BM premium license, multiple tokens (0.50s)
1597:  �[32m✓�[0m Get apple BM premium license, no token (0.42s)
1598:  �[32m✓�[0m Get apple BM premium license, single token (0.50s)
1599:  �[32m✓�[0m Get apple MDM (0.43s)
1600:  �[32m✓�[0m Get carve (0.35s)
1601:  �[32m✓�[0m Get carve with error (0.39s)
1602:  �[32m✓�[0m Get carves (0.38s)
...

1609:  �[32m✓�[0m Get config app config as team users (0.05s)
1610:  �[32m✓�[0m Get config include server config (0.02s)
1611:  �[32m✓�[0m Get config remove deprecated keys (0.01s)
1612:  �[32m✓�[0m Get enrollment secrets (0.51s)
1613:  �[32m✓�[0m Get hosts (0.44s)
1614:  �[32m✓�[0m Get hosts MDM (0.41s)
1615:  �[32m✓�[0m Get hosts MDM get hosts - -mdm - -json - expected list hosts MD m .json (0.00s)
1616:  �[32m✓�[0m Get hosts MDM get hosts - -mdm - -mdm-pending - (0.00s)
1617:  �[32m✓�[0m Get hosts MDM get hosts - -mdm-pending - -yaml - expected list hosts yaml.yml (0.01s)
1618:  �[32m✓�[0m Get hosts get hosts - -json - -remove-deprecated-keys (0.00s)
1619:  �[32m✓�[0m Get hosts get hosts - -json - expected list hosts json.json (0.00s)
1620:  �[32m✓�[0m Get hosts get hosts - -json test host - expected host detail response json.json (0.00s)
1621:  �[32m✓�[0m Get hosts get hosts - -yaml - expected list hosts yaml.yml (0.00s)
1622:  �[32m✓�[0m Get hosts get hosts - -yaml test host - expected host detail response yaml.yml (0.00s)
1623:  �[32m✓�[0m Get label (0.35s)
1624:  �[32m✓�[0m Get label usage multiple label keys error (0.00s)
1625:  �[32m✓�[0m Get label usage profile path shortened (0.00s)
...

1632:  �[32m✓�[0m Get queries as observer observer of multiple teams (0.01s)
1633:  �[32m✓�[0m Get queries as observer team observer (0.01s)
1634:  �[32m✓�[0m Get query (0.49s)
1635:  �[32m✓�[0m Get query labels include all (0.34s)
1636:  �[32m✓�[0m Get reports labels include all (0.45s)
1637:  �[32m✓�[0m Get software titles (0.38s)
1638:  �[32m✓�[0m Get software versions (0.42s)
1639:  �[32m✓�[0m Get teams (0.87s)
1640:  �[32m✓�[0m Get teams YAML and apply (0.47s)
1641:  �[32m✓�[0m Get teams by name (0.43s)
1642:  �[32m✓�[0m Get teams expired license (0.39s)
1643:  �[32m✓�[0m Get teams not expired license (0.48s)
1644:  �[32m✓�[0m Get user roles (0.41s)
1645:  �[32m✓�[0m Git ops ABM (5.35s)
1646:  �[32m✓�[0m Git ops ABM backwards compat (0.66s)
1647:  �[32m✓�[0m Git ops ABM both keys errors (0.41s)
1648:  �[32m✓�[0m Git ops ABM deprecated config with two tokens in the db fails (0.55s)
1649:  �[32m✓�[0m Git ops ABM new key all valid (0.59s)
1650:  �[32m✓�[0m Git ops ABM new key multiple elements (0.64s)
1651:  �[32m✓�[0m Git ops ABM no team is supported (0.40s)
1652:  �[32m✓�[0m Git ops ABM non existent org name fails (0.43s)
1653:  �[32m✓�[0m Git ops ABM not provided teams defaults to no team (0.42s)
1654:  �[32m✓�[0m Git ops ABM renamed new key all valid (0.57s)
1655:  �[32m✓�[0m Git ops ABM using an undefined team errors (0.67s)
1656:  �[32m✓�[0m Git ops EULA setting (4.10s)
...

1659:  �[32m✓�[0m Git ops EULA setting not a PDF file (0.56s)
1660:  �[32m✓�[0m Git ops EULA setting relative path to working dir to pdf file (no existing EULA uploaded) (0.39s)
1661:  �[32m✓�[0m Git ops EULA setting relative path to yaml file to pdf file (no existing EULA uploaded) (0.44s)
1662:  �[32m✓�[0m Git ops EULA setting uploading the same EULA again (0.56s)
1663:  �[32m✓�[0m Git ops EULA setting valid new pdf file (different EULA already uploaded) (0.55s)
1664:  �[32m✓�[0m Git ops EULA setting valid pdf file (no existing EULA uploaded) (0.47s)
1665:  �[32m✓�[0m Git ops MDM auth settings (0.56s)
1666:  �[32m✓�[0m Git ops SMTP settings (0.56s)
1667:  �[32m✓�[0m Git ops SSO server URL (0.43s)
1668:  �[32m✓�[0m Git ops SSO settings (0.50s)
1669:  �[32m✓�[0m Git ops android certificates add (0.73s)
1670:  �[32m✓�[0m Git ops android certificates change (0.59s)
1671:  �[32m✓�[0m Git ops android certificates delete all (0.54s)
1672:  �[32m✓�[0m Git ops android certificates delete one (0.49s)
1673:  �[32m✓�[0m Git ops app store app auto update (0.43s)
1674:  �[32m✓�[0m Git ops app store app auto update invalid auto-update window triggers error and does not call update software title auto update config (0.01s)
1675:  �[32m✓�[0m Git ops app store app auto update no auto update settings and no existing schedule does not call update software title auto update config (0.01s)
...

1678:  �[32m✓�[0m Git ops apple OS updates (0.58s)
1679:  �[32m✓�[0m Git ops apple OS updates ios updates (0.05s)
1680:  �[32m✓�[0m Git ops apple OS updates ios updates changed deadline triggers bulk set pending MDM host profiles (0.01s)
1681:  �[32m✓�[0m Git ops apple OS updates ios updates changed minimum version triggers bulk set pending MDM host profiles (0.02s)
1682:  �[32m✓�[0m Git ops apple OS updates ios updates same values do not trigger bulk set pending MDM host profiles (0.02s)
1683:  �[32m✓�[0m Git ops apple OS updates ipados updates (0.05s)
1684:  �[32m✓�[0m Git ops apple OS updates ipados updates changed deadline triggers bulk set pending MDM host profiles (0.02s)
1685:  �[32m✓�[0m Git ops apple OS updates ipados updates changed minimum version triggers bulk set pending MDM host profiles (0.02s)
1686:  �[32m✓�[0m Git ops apple OS updates ipados updates same values do not trigger bulk set pending MDM host profiles (0.02s)
1687:  �[32m✓�[0m Git ops apple OS updates macos updates (0.05s)
1688:  �[32m✓�[0m Git ops apple OS updates macos updates changed deadline triggers bulk set pending MDM host profiles (0.01s)
1689:  �[32m✓�[0m Git ops apple OS updates macos updates changed minimum version triggers bulk set pending MDM host profiles (0.02s)
1690:  �[32m✓�[0m Git ops apple OS updates macos updates same values do not trigger bulk set pending MDM host profiles (0.02s)
1691:  �[32m✓�[0m Git ops basic global and no team (0.62s)
1692:  �[32m✓�[0m Git ops basic global and no team basic global and no-team.yml (0.05s)
1693:  �[32m✓�[0m Git ops basic global and no team both global and no-team.yml define controls -- should fail (0.01s)
1694:  �[32m✓�[0m Git ops basic global and no team controls only defined in no-team.yml (0.05s)
1695:  �[32m✓�[0m Git ops basic global and no team global DOES NOT define controls -- should fail (0.01s)
1696:  �[32m✓�[0m Git ops basic global and no team global and no-team.yml DO NOT define controls -- should fail (0.01s)
1697:  �[32m✓�[0m Git ops basic global and no team global defines software -- should fail (0.01s)
1698:  �[32m✓�[0m Git ops basic global and no team no-team provided without global -- should fail (0.01s)
1699:  �[32m✓�[0m Git ops basic global and no team no-team.yml defines policy with calendar events enabled -- should fail (0.01s)
1700:  �[32m✓�[0m Git ops basic global and no team unassigned provided without global -- should fail (0.01s)
1701:  �[32m✓�[0m Git ops basic global and team (0.61s)
...

1707:  �[32m✓�[0m Git ops custom settings global macos windows custom settings valid.yml (0.46s)
1708:  �[32m✓�[0m Git ops custom settings global windows custom settings invalid label mix 2 .yml (0.59s)
1709:  �[32m✓�[0m Git ops custom settings global windows custom settings invalid label mix.yml (0.53s)
1710:  �[32m✓�[0m Git ops custom settings global windows custom settings unknown label.yml (0.56s)
1711:  �[32m✓�[0m Git ops custom settings team macos custom settings valid deprecated.yml (0.55s)
1712:  �[32m✓�[0m Git ops custom settings team macos windows custom settings invalid labels mix 2 .yml (0.46s)
1713:  �[32m✓�[0m Git ops custom settings team macos windows custom settings invalid labels mix.yml (0.51s)
1714:  �[32m✓�[0m Git ops custom settings team macos windows custom settings unknown label.yml (0.49s)
1715:  �[32m✓�[0m Git ops custom settings team macos windows custom settings valid.yml (0.60s)
1716:  �[32m✓�[0m Git ops dry run rejects invalid label platform (0.41s)
1717:  �[32m✓�[0m Git ops exception enforcement (0.45s)
1718:  �[32m✓�[0m Git ops exception enforcement free tier (0.38s)
1719:  �[32m✓�[0m Git ops exceptions preserve omitted keys (0.36s)
1720:  �[32m✓�[0m Git ops features (0.46s)
1721:  �[32m✓�[0m Git ops filename validation (0.00s)
1722:  �[32m✓�[0m Git ops fleet failing policies webhook policy IDs (0.42s)
1723:  �[32m✓�[0m Git ops fleet webhooks and tickets enabled (0.61s)
...

1888:  �[32m✓�[0m Run api command get scripts full path missing (0.01s)
1889:  �[32m✓�[0m Run api command get scripts team (0.00s)
1890:  �[32m✓�[0m Run api command get scripts team no cache (0.00s)
1891:  �[32m✓�[0m Run api command get typo (0.00s)
1892:  �[32m✓�[0m Run api command upload script (0.00s)
1893:  �[32m✓�[0m Run script command (0.68s)
1894:  �[32m✓�[0m Run script command disabled scripts globally (0.01s)
1895:  �[32m✓�[0m Run script command host not found (0.01s)
1896:  �[32m✓�[0m Run script command invalid file type (0.00s)
1897:  �[32m✓�[0m Run script command invalid hashbang (0.01s)
1898:  �[32m✓�[0m Run script command invalid utf 8 (0.00s)
1899:  �[32m✓�[0m Run script command missing one of script-path and script-nqme (0.00s)
1900:  �[32m✓�[0m Run script command output truncated (0.01s)
1901:  �[32m✓�[0m Run script command posix shell hashbang (0.01s)
1902:  �[32m✓�[0m Run script command script empty (0.01s)
1903:  �[32m✓�[0m Run script command script failed (0.01s)
1904:  �[32m✓�[0m Run script command script killed (0.01s)
...

1942:  �[32m✓�[0m User is observer (0.00s)
1943:  �[32m✓�[0m User is observer global maintainer (0.00s)
1944:  �[32m✓�[0m User is observer global observer (0.00s)
1945:  �[32m✓�[0m User is observer global observer+ (0.00s)
1946:  �[32m✓�[0m User is observer team maintainer (0.00s)
1947:  �[32m✓�[0m User is observer team observer (0.00s)
1948:  �[32m✓�[0m User is observer team observer and maintainer (0.00s)
1949:  �[32m✓�[0m User is observer team observer+ (0.00s)
1950:  �[32m✓�[0m User is observer user without roles (0.00s)
1951:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/gitops:
1952:  �[32m✓�[0m Git ops VPP (4.30s)
1953:  �[32m✓�[0m Git ops VPP all teams is supported (0.78s)
1954:  �[32m✓�[0m Git ops VPP new key all valid (0.70s)
1955:  �[32m✓�[0m Git ops VPP new key multiple elements (0.62s)
1956:  �[32m✓�[0m Git ops VPP no team is supported (0.75s)
1957:  �[32m✓�[0m Git ops VPP non existent location fails (0.42s)
1958:  �[32m✓�[0m Git ops VPP not provided teams defaults to no team (0.51s)
1959:  �[32m✓�[0m Git ops VPP using an undefined team errors (0.53s)
1960:  �[32m✓�[0m Git ops existing team VPP apps with missing team (0.59s)
...

2048:  �[32m✓�[0m Git ops team software installers team software installer with display name.yml (1.52s)
2049:  �[32m✓�[0m Integrations enterprise gitops (337.79s)
2050:  �[32m✓�[0m Integrations enterprise gitops test CA integrations (4.84s)
2051:  �[32m✓�[0m Integrations enterprise gitops test FMA labels include all (7.07s)
2052:  �[32m✓�[0m Integrations enterprise gitops test IPA software installers (10.27s)
2053:  �[32m✓�[0m Integrations enterprise gitops test JSON configuration profile escaping (1.47s)
2054:  �[32m✓�[0m Integrations enterprise gitops test add manual labels (1.95s)
2055:  �[32m✓�[0m Integrations enterprise gitops test configuration profile escaping (1.51s)
2056:  �[32m✓�[0m Integrations enterprise gitops test delete CA with certificate templates (6.88s)
2057:  �[32m✓�[0m Integrations enterprise gitops test delete mac OS setup (6.18s)
2058:  �[32m✓�[0m Integrations enterprise gitops test deleting no team YAML (3.27s)
2059:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience (125.27s)
2060:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience all VPP with setup experience (1.53s)
2061:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience no team VPP (1.29s)
2062:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience no team installers (60.98s)
2063:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience packages fail (61.27s)
2064:  �[32m✓�[0m Integrations enterprise gitops test dry run mac OS setup script with manual agent install conflict (0.78s)
...

2092:  �[32m✓�[0m Integrations enterprise gitops test omitted top level keys global (2.87s)
2093:  �[32m✓�[0m Integrations enterprise gitops test remove custom settings from default YAML (3.10s)
2094:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps (4.54s)
2095:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps all teams (2.83s)
2096:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps no team (1.53s)
2097:  �[32m✓�[0m Integrations enterprise gitops test unset configuration profile labels (5.85s)
2098:  �[32m✓�[0m Integrations enterprise gitops test unset software installer labels (9.83s)
2099:  �[32m✓�[0m Integrations enterprise starter library (5.17s)
2100:  �[32m✓�[0m Integrations enterprise starter library test apply starter library premium (3.84s)
2101:  �[32m✓�[0m Integrations gitops (2.66s)
2102:  �[32m✓�[0m Integrations gitops test fleet gitops (0.65s)
2103:  �[32m✓�[0m Integrations gitops test fleet gitops DDM fleet vars requires premium (0.17s)
2104:  �[32m✓�[0m Integrations gitops test fleet gitops with fleet secrets (0.45s)
2105:  �[32m✓�[0m Integrations starter library (1.64s)
2106:  �[32m✓�[0m Integrations starter library test apply starter library free (0.30s)
2107:  === �[31mFailed�[0m
2108:  === �[31mFAIL�[0m: cmd/fleetctl/integrationtest/vuln TestIntegrationsVulnerabilityDataStream (91.83s)
2109:  nettest.go:33: network test start: TestIntegrationsVulnerabilityDataStream
2110:  vulnerability_data_stream_test.go:44: 
2111:  Error Trace:	/home/runner/work/fleet/fleet/cmd/fleetctl/integrationtest/vuln/vulnerability_data_stream_test.go:44
2112:  Error:      	Received unexpected error:
2113:  Error downloading OSV artifacts: getting latest release: github http status error: 403
2114:  Test:       	TestIntegrationsVulnerabilityDataStream
2115:  nettest.go:36: network test done: TestIntegrationsVulnerabilityDataStream
2116:  DONE 846 tests, 1 failure in 665.795s
2117:  make[1]: *** [Makefile:280: .run-go-tests] Error 1
2118:  make[1]: Leaving directory '/home/runner/work/fleet/fleet'
2119:  make: *** [Makefile:395: test-go] Error 2
2120:  ##[error]Process completed with exit code 2.
2121:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2122:  with:
2123:  name: fleetctl-mysql8.0.44-coverage
2124:  path: ./coverage.txt
2125:  if-no-files-found: error
2126:  compression-level: 6
...

2138:  With the provided path, there will be 1 file uploaded
2139:  Artifact name is valid!
2140:  Root directory input is valid!
2141:  Beginning upload of artifact content to blob storage
2142:  Uploaded bytes 2183934
2143:  Finished uploading artifact content to blob storage!
2144:  SHA256 hash of uploaded artifact zip is 88228ab08bc81c20c1cbad3d17c2a6f0be990231dc523f98a2fa9748f253957b
2145:  Finalizing artifact upload
2146:  Artifact fleetctl-mysql8.0.44-coverage.zip successfully finalized. Artifact ID 7018254707
2147:  Artifact fleetctl-mysql8.0.44-coverage has been successfully uploaded! Final size is 2183934 bytes. Artifact ID is 7018254707
2148:  Artifact download URL: https://github.com/fleetdm/fleet/actions/runs/25919972285/artifacts/7018254707
2149:  ##[group]Run c1grep() { grep "$@" || test $? = 1; }
2150:  �[36;1mc1grep() { grep "$@" || test $? = 1; }�[0m
2151:  �[36;1mc1grep -oP 'FAIL: .*$' /tmp/gotest.log > /tmp/summary.txt�[0m
2152:  �[36;1mc1grep 'test timed out after' /tmp/gotest.log >> /tmp/summary.txt�[0m
2153:  �[36;1mc1grep 'fatal error:' /tmp/gotest.log >> /tmp/summary.txt�[0m
2154:  �[36;1mc1grep -A 10 'panic: runtime error: ' /tmp/gotest.log >> /tmp/summary.txt�[0m
2155:  �[36;1mc1grep ' FAIL\t' /tmp/gotest.log >> /tmp/summary.txt�[0m
2156:  �[36;1mGO_FAIL_SUMMARY=$(head -n 5 /tmp/summary.txt | sed ':a;N;$!ba;s/\n/\\n/g')�[0m
2157:  �[36;1mecho "GO_FAIL_SUMMARY=$GO_FAIL_SUMMARY"�[0m
2158:  �[36;1mif [[ -z "$GO_FAIL_SUMMARY" ]]; then�[0m
2159:  �[36;1m  GO_FAIL_SUMMARY="unknown, please check the build URL"�[0m
2160:  �[36;1mfi�[0m
2161:  �[36;1mGO_FAIL_SUMMARY=$GO_FAIL_SUMMARY envsubst < .github/workflows/config/slack_payload_template.json > ./payload.json�[0m
2162:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2163:  env:
2164:  RACE_ENABLED: false
2165:  GO_TEST_TIMEOUT: 20m
2166:  DOCKER_COMMAND: docker compose -f docker-compose.yml -f docker-compose-redis-cluster.yml up -d mysql_test mysql_replica_test redis redis-cluster-1 redis-cluster-2 redis-cluster-3 redis-cluster-4 redis-cluster-5 redis-cluster-6 redis-cluster-setup s3 saml_idp mailhog mailpit smtp4dev_test
2167:  RUN_TESTS_ARG: 
2168:  CI_TEST_PKG: fleetctl
2169:  NEED_DOCKER: 1
2170:  ARTIFACT_PREFIX: fleetctl-mysql8.0.44
2171:  GOTOOLCHAIN: local
2172:  ##[endgroup]
2173:  GO_FAIL_SUMMARY=
2174:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2175:  with:
2176:  name: fleetctl-mysql8.0.44-test-log
2177:  path: /tmp/gotest.log
2178:  if-no-files-found: error
2179:  compression-level: 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants