Skip to content
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

More attempts to get CI to be less flaky #18652

Closed
wants to merge 6 commits into from
Closed
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: 6 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ jobs:
src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata'
- name: Validate CI config
run: './pants run build-support/bin/generate_github_workflows.py -- --check

'
# - name: Validate CI config
# run: './pants run build-support/bin/generate_github_workflows.py -- --check
#
# '
- env:
TMPDIR: ${{ runner.temp }}
if: needs.classify_changes.outputs.rust == 'true'
Expand Down Expand Up @@ -822,6 +822,8 @@ jobs:
run: 'echo TOOLCHAIN_AUTH_TOKEN="${{ secrets.TOOLCHAIN_AUTH_TOKEN }}" >> $GITHUB_ENV

'
- name: Setup upterm session
uses: lhotari/action-upterm@v1
- name: Run Python test shard 0/3
run: './pants test --shard=0/3 ::

Expand Down
1 change: 1 addition & 0 deletions src/python/pants/backend/go/util_rules/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ python_tests(
timeout=120,
overrides={
"embed_integration_test.py": {"timeout": 240},
"cgo_test.py": {"timeout": 240},
},
)
6 changes: 5 additions & 1 deletion src/python/pants/core/goals/tailor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,12 @@ def test_tailor_rule_write_mode(rule_runner: RuleRunner) -> None:
"conflict/BUILD": "fortran_library(sources=['f1.f90'])",
}
)
# Ensure the test invocation of Pants doesn't restart itself after it writes the tailored files,
# and then chokes on the invalid BUILD symbol.
result = rule_runner.run_goal_rule(
TailorGoal, args=["--alias-mapping={'fortran_library': 'my_fortran_lib'}", "::"]
TailorGoal,
global_args=["--no-watch-filesystem", "--no-pantsd"],
args=["--tailor-alias-mapping={'fortran_library': 'my_fortran_lib'}", "::"],
)
Comment on lines +431 to 437
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an integration test, so no external processes or pantsd are spawned: everything runs in process, and file invalidation happens synchronously during the write_files call. So these arguments have no effect.

assert result.exit_code == 0
assert result.stdout == dedent(
Expand Down
16 changes: 16 additions & 0 deletions src/python/pants/pantsd/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

from __future__ import annotations

import datetime
import logging
import os
import signal
import subprocess
import sys
import time
import traceback
Expand Down Expand Up @@ -381,6 +383,20 @@ def is_alive(self, extended_check=None):
"""
try:
process = self._as_process()
if process:
print(
f"{str(datetime.datetime.now())} 111111111111 "
f"Process state: id={process.pid}, status={process.status()}, "
f"process_name={self.process_name}, "
f"computed process_name={self._get_process_name(process)}"
)
if process.status() == psutil.STATUS_SLEEPING:
cp = subprocess.run(
["strace", "-p", f"{process.pid}"], capture_output=True, timeout=1
)
print(f"XXXXXXX {cp.returncode} {cp.stdout} | {cp.stderr}")
else:
print(f"{str(datetime.datetime.now())} 22222222222 Process is None, somehow")
return not (
# Can happen if we don't find our pid.
(not process)
Expand Down
4 changes: 2 additions & 2 deletions tests/python/pants_test/pantsd/pantsd_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def test_pantsd_invalidation_file_tracking(self):
ctx.checker.assert_started()

# See comment in `test_pantsd_invalidation_pants_toml_file`.
time.sleep(15)
time.sleep(30)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a recent attempt at bumping these, without luck.

It might be a good idea to assign me a ticket to more deeply investigate these, and then skip them for now.

ctx.checker.assert_running()

def full_pants_log():
Expand Down Expand Up @@ -384,7 +384,7 @@ def test_pantsd_invalidation_pants_toml_file(self):
# This accounts for the amount of time it takes for the SchedulerService to begin watching
# these files. That happens asynchronously after `pantsd` startup, and may take a long
# time in a heavily loaded test environment.
time.sleep(15)
time.sleep(30)

# Delete tmp_pants_toml
os.unlink(tmp_pants_toml)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def attempts(
msg: str,
*,
delay: float = 0.5,
timeout: float = 30,
timeout: float = 60,
backoff: float = 1.2,
) -> Iterator[None]:
"""A generator that yields a number of times before failing.
Expand Down