Skip to content

Infinite recursion during copying to stage directory if 'sourcesdir' is a relative path #221

@vkarak

Description

@vkarak

Here is the scenario, which is a typical scenario for usage of the framework as development CI tool:

Directory structure

ci-scripts/
    hellocheck.py
src/
    hello.c

hello.c

#include <stdio.h>

int main()
{
    printf("Hello, World!\n");
    return 0;
}

hellocheck.py

import os

import reframe.utility.sanity as sn
from reframe.core.pipeline import RegressionTest


class HelloTest(RegressionTest):
    def __init__(self, **kwargs):
        super().__init__('hellocheck', os.path.dirname(__file__), **kwargs)
        self.descr = 'C Hello World test'

        # All available systems are supported
        self.valid_systems = ['*']
        self.valid_prog_environs = ['*']
        self.sourcesdir = os.path.join(self.prefix, '..')
        self.sourcepath = 'hello.c'
        self.tags = {'foo', 'bar'}
        self.sanity_patterns = sn.assert_found(r'Hello, World\!', self.stdout)
        self.maintainers = ['VK']


def _get_checks(**kwargs):
    return [HelloTest(**kwargs)]

Run from the top-level dir with

reframe -c ci-scripts/hellocheck.py -r

Output (full path is not shown):

Reframe version: 2.11
Launched by user: karakasv
Launched on host: dom101
Reframe paths
=============
    Check prefix      :
    Check search path : 'ci-scripts/hellocheck.py'
    Stage dir prefix  : /users/karakasv/Devel/reframe/mytests/sourcesdir-relpath/stage/
    Output dir prefix : /users/karakasv/Devel/reframe/mytests/sourcesdir-relpath/output/
    Logging dir       : /users/karakasv/Devel/reframe/mytests/sourcesdir-relpath/logs
[==========] Running 1 check(s)
[==========] Started on Thu Mar 22 14:06:00 2018

[----------] started processing hellocheck (C Hello World test)
[ RUN      ] hellocheck on dom:login using PrgEnv-cray
[     FAIL ] hellocheck on dom:login using PrgEnv-cray
[ RUN      ] hellocheck on dom:login using PrgEnv-gnu
^C[     FAIL ] hellocheck on dom:login using PrgEnv-gnu
[  FAILED  ] Ran 2 test case(s) from 1 check(s) (2 failure(s))
[==========] Finished on Thu Mar 22 14:06:11 2018
==============================================================================
SUMMARY OF FAILURES
------------------------------------------------------------------------------
FAILURE INFO for hellocheck
  * System partition: dom:login
  * Environment: PrgEnv-cray
  * Stage directory: /users/karakasv/Devel/reframe/mytests/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray
  * Job type: batch job (id=None)
  * Maintainers: ['VK']
  * Failing phase: compile
  * Reason: caught framework exception: virtual copying of files failed: [('/users/karakasv/Devel/reframe/mytests/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-cray/sourcesdir-relpath'")]
------------------------------------------------------------------------------
FAILURE INFO for hellocheck
  * System partition: dom:login
  * Environment: PrgEnv-gnu
  * Stage directory: /users/karakasv/Devel/reframe/mytests/sourcesdir-relpath/stage/login/hellocheck/PrgEnv-gnu
  * Job type: batch job (id=None)
  * Maintainers: ['VK']
  * Failing phase: compile
  * Reason: cancelled by user
------------------------------------------------------------------------------

If you run with --prefix pointing to a different directory, everything runs as expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions