diff mbox

[i-g-t] tests/debugfs_test: Add a shorter timeout when reading sysfs entries

Message ID 1499851044-4678-1-git-send-email-abdiel.janulgue@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Abdiel Janulgue July 12, 2017, 9:17 a.m. UTC
This allows us to proceed gracefully without invoking the global
CI-level timeout especially when opening the buggy crtc-data
file descriptor.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
---
 tests/debugfs_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Arkadiusz Hiler July 14, 2017, 11:37 a.m. UTC | #1
On Wed, Jul 12, 2017 at 12:17:24PM +0300, Abdiel Janulgue wrote:
> This allows us to proceed gracefully without invoking the global
> CI-level timeout especially when opening the buggy crtc-data
> file descriptor.
> 
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> ---
>  tests/debugfs_test.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
> index fb1735b..aefc123 100644
> --- a/tests/debugfs_test.c
> +++ b/tests/debugfs_test.c
> @@ -52,8 +52,11 @@ static void read_and_discard_sysfs_entries(int path_fd, bool is_crc)
>  			read_and_discard_sysfs_entries(sub_fd, !strcmp(dirent->d_name, "crc"));
>  			close(sub_fd);
>  		} else {
> -			char *buf = igt_sysfs_get(path_fd, dirent->d_name);
> +			char *buf;
>  
> +			igt_set_timeout(5, "reading sysfs entry");
> +			buf = igt_sysfs_get(path_fd, dirent->d_name);
> +			igt_reset_timeout();

5 sounds like more than enough.

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
diff mbox

Patch

diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index fb1735b..aefc123 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -52,8 +52,11 @@  static void read_and_discard_sysfs_entries(int path_fd, bool is_crc)
 			read_and_discard_sysfs_entries(sub_fd, !strcmp(dirent->d_name, "crc"));
 			close(sub_fd);
 		} else {
-			char *buf = igt_sysfs_get(path_fd, dirent->d_name);
+			char *buf;
 
+			igt_set_timeout(5, "reading sysfs entry");
+			buf = igt_sysfs_get(path_fd, dirent->d_name);
+			igt_reset_timeout();
 			/*
 			 * /crtc-XX/crc/data may fail with -EIO if the CRTC
 			 * is not active.