<#2745 [flyteagent] FileSensor Timeout (Remote Exe...
# flyte-github
c
#2745 [flyteagent] FileSensor Timeout (Remote Execution Only) Pull request opened by Future-Outlier ## Tracking issue flyteorg/flyte#5035 ## Why are the changes needed? timeout is important for sensor task. ## What changes were proposed in this pull request? add a parameter
timeout
in
FileSensor
and
BaseSensor
. ## How was this patch tested? from flytekit import task, workflow from flytekit.sensor.file_sensor import FileSensor sensor = FileSensor(name="test_file_sensor", timeout=1) @task def t1(): return @workflow def wf(): sensor(path="/tmp/abcde") ### Setup process ### Screenshots [image](https://private-user-images.githubusercontent.com/76461262/421657222-f13a9c55-56eb-447d-bcaa-de540aac98a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDE5MTk1MjUsIm5iZiI6MTc0MTkxOTIyNSwicGF0aCI6Ii83NjQ2MTI2Mi80MjE2NTcyMjItZjEzYTljNTUtNTZlYi00NDdkLWJjYWEtZGU1NDBhYWM5OGExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAzMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMzE0VDAyMjcwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYzMzAzODZjOTk5YTBjYTljODk3YmMzNzE1OTE3Y2Q2ZTg5YzJiYjY0NmFlMmMxNmFlMWEyNDE4MWM2YmM3NzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.FnJhie7dIW0cpaiU5JjNE80Kr44skH_p3r2mT9Qcpas) ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs ## Docs link ### Summary by Bito This PR implements timeout configuration support across multiple components, integrating it into task metadata with conflict warnings. The BaseSensor includes timeout validation with guards to prevent setting timeout and metadata simultaneously. The changes enhance the sensor testing suite by adding new test cases that validate behavior when timeout and TaskMetadata are set concurrently, improving test coverage and supporting FlyteKit's timeout functionality. Unit tests added: True Estimated effort to review (1-5, lower is better): 2 flyteorg/flytekit