You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexander Kitaev <Al...@svnkit.com> on 2008/03/12 18:12:38 UTC

[PATCH] python/cmdline

Hello,

Attached are patches that fixes number of minor issues in Subversion 
python tests suite. Patch is against 1.1.x branch.

Explanation:

1. main.py patch

Recently we started to use client/server approach for running Subversion 
python tests suite against SVNKit Subversion library. We use server that 
accepts Subversion commands through the TCP/IP socket and client which 
is a bash script - it reads parameters, stdin, certain environment 
variables and then sends everything to the server.

To send data to the server we use netcat or, alternatively, bash 
/dev/tcp/host/port device. In both case complete stdin have to be read 
before sending data to the server. However, main.py doesn't close stdin 
of the launched process before launching another process (in particular 
when running svnadmin dump repos1 | svnadmin load repos2 commands). As a 
result our tests were entering a deadlock. Suggested patch doesn't 
change anything in tests behavior with native Subversion - it just 
closes stdin of the launched process as soon as no more data is about to 
be sent to the process stdin.

Another modification included into this patch is setting 
SVN_CURRENT_TEST environment variable before running certain test. This 
allows us to track what test is currently running when the whole test 
suite is launched (i.e. "./copy.py" without specifying exact test number 
to run).

2. copy_tests.py patch

Copy 12 test expects "sleep_for_timestamp" behavior to be enabled (that 
is disabled by default for tests). As a result sometimes copy 12 pass 
and sometimes not. Patch enables sleep_for_timestamp for copy 12 test.

Thanks!

-- 
Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Re: [PATCH] python/cmdline

Posted by Alexander Kitaev <Al...@svnkit.com>.
Sorry, of course I mean 1.5.x branch, mixed that up with our project
branches :(

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Mark Phippard wrote:
> Did you mean to send this?  The 1.1.x branch seems odd and I thought I
> remember you sending this patch a year or more ago.
> 
> Mark
> 
> 
> 
> 2008/3/12 Alexander Kitaev <Al...@svnkit.com>:
>> Hello,
>>
>>  Attached are patches that fixes number of minor issues in Subversion
>>  python tests suite. Patch is against 1.1.x branch.
>>
>>  Explanation:
>>
>>  1. main.py patch
>>
>>  Recently we started to use client/server approach for running Subversion
>>  python tests suite against SVNKit Subversion library. We use server that
>>  accepts Subversion commands through the TCP/IP socket and client which
>>  is a bash script - it reads parameters, stdin, certain environment
>>  variables and then sends everything to the server.
>>
>>  To send data to the server we use netcat or, alternatively, bash
>>  /dev/tcp/host/port device. In both case complete stdin have to be read
>>  before sending data to the server. However, main.py doesn't close stdin
>>  of the launched process before launching another process (in particular
>>  when running svnadmin dump repos1 | svnadmin load repos2 commands). As a
>>  result our tests were entering a deadlock. Suggested patch doesn't
>>  change anything in tests behavior with native Subversion - it just
>>  closes stdin of the launched process as soon as no more data is about to
>>  be sent to the process stdin.
>>
>>  Another modification included into this patch is setting
>>  SVN_CURRENT_TEST environment variable before running certain test. This
>>  allows us to track what test is currently running when the whole test
>>  suite is launched (i.e. "./copy.py" without specifying exact test number
>>  to run).
>>
>>  2. copy_tests.py patch
>>
>>  Copy 12 test expects "sleep_for_timestamp" behavior to be enabled (that
>>  is disabled by default for tests). As a result sometimes copy 12 pass
>>  and sometimes not. Patch enables sleep_for_timestamp for copy 12 test.
>>
>>  Thanks!
>>
>>  --
>>  Alexander Kitaev,
>>  TMate Software,
>>  http://svnkit.com/ - Java [Sub]Versioning Library!
>>
>> Index: copy_tests.py
>>  ===================================================================
>>  --- copy_tests.py       (revision 29877)
>>  +++ copy_tests.py       (working copy)
>>  @@ -900,7 +900,9 @@
>>    pi_path = os.path.join(wc_dir, 'pi')
>>
>>    svntest.actions.run_and_verify_svn(None, None, [], 'copy', E_url, wc_dir)
>>  +  svntest.actions.do_sleep_for_timestamps()
>>    svntest.actions.run_and_verify_svn(None, None, [], 'copy', pi_url, wc_dir)
>>  +  svntest.actions.no_sleep_for_timestamps()
>>
>>    # Extra test: modify file ASAP to check there was a timestamp sleep
>>    svntest.main.file_append(pi_path, 'zig\n')
>>
>> Index: svntest/main.py
>>  ===================================================================
>>  --- svntest/main.py     (revision 29877)
>>  +++ svntest/main.py     (working copy)
>>  @@ -638,6 +638,7 @@
>>
>>    dump_in, dump_out, dump_err, dump_kid = \
>>             open_pipe(svnadmin_binary + dump_args, 'b')
>>  +  dump_in.close()
>>    load_in, load_out, load_err, load_kid = \
>>             open_pipe(svnadmin_binary + load_args, 'b')
>>    stop = time.time()
>>  @@ -653,7 +654,6 @@
>>
>>    dump_lines = dump_err.readlines()
>>    load_lines = load_out.readlines()
>>  -  dump_in.close()
>>    dump_out.close()
>>    dump_err.close()
>>    load_out.close()
>>  @@ -1052,6 +1052,7 @@
>>      # Tests that want to use an editor should invoke svntest.main.use_editor.
>>      os.environ['SVN_EDITOR'] = ''
>>      os.environ['SVNTEST_EDITOR_FUNC'] = ''
>>  +    os.environ['SVN_CURRENT_TEST'] = os.path.basename(sys.argv[0]) + "_" + str(self.index)
>>      actions.no_sleep_for_timestamps()
>>
>>      saved_dir = os.getcwd()
>>
>>
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>>  For additional commands, e-mail: dev-help@subversion.tigris.org
>>
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] python/cmdline

Posted by Mark Phippard <ma...@gmail.com>.
Did you mean to send this?  The 1.1.x branch seems odd and I thought I
remember you sending this patch a year or more ago.

Mark



2008/3/12 Alexander Kitaev <Al...@svnkit.com>:
> Hello,
>
>  Attached are patches that fixes number of minor issues in Subversion
>  python tests suite. Patch is against 1.1.x branch.
>
>  Explanation:
>
>  1. main.py patch
>
>  Recently we started to use client/server approach for running Subversion
>  python tests suite against SVNKit Subversion library. We use server that
>  accepts Subversion commands through the TCP/IP socket and client which
>  is a bash script - it reads parameters, stdin, certain environment
>  variables and then sends everything to the server.
>
>  To send data to the server we use netcat or, alternatively, bash
>  /dev/tcp/host/port device. In both case complete stdin have to be read
>  before sending data to the server. However, main.py doesn't close stdin
>  of the launched process before launching another process (in particular
>  when running svnadmin dump repos1 | svnadmin load repos2 commands). As a
>  result our tests were entering a deadlock. Suggested patch doesn't
>  change anything in tests behavior with native Subversion - it just
>  closes stdin of the launched process as soon as no more data is about to
>  be sent to the process stdin.
>
>  Another modification included into this patch is setting
>  SVN_CURRENT_TEST environment variable before running certain test. This
>  allows us to track what test is currently running when the whole test
>  suite is launched (i.e. "./copy.py" without specifying exact test number
>  to run).
>
>  2. copy_tests.py patch
>
>  Copy 12 test expects "sleep_for_timestamp" behavior to be enabled (that
>  is disabled by default for tests). As a result sometimes copy 12 pass
>  and sometimes not. Patch enables sleep_for_timestamp for copy 12 test.
>
>  Thanks!
>
>  --
>  Alexander Kitaev,
>  TMate Software,
>  http://svnkit.com/ - Java [Sub]Versioning Library!
>
> Index: copy_tests.py
>  ===================================================================
>  --- copy_tests.py       (revision 29877)
>  +++ copy_tests.py       (working copy)
>  @@ -900,7 +900,9 @@
>    pi_path = os.path.join(wc_dir, 'pi')
>
>    svntest.actions.run_and_verify_svn(None, None, [], 'copy', E_url, wc_dir)
>  +  svntest.actions.do_sleep_for_timestamps()
>    svntest.actions.run_and_verify_svn(None, None, [], 'copy', pi_url, wc_dir)
>  +  svntest.actions.no_sleep_for_timestamps()
>
>    # Extra test: modify file ASAP to check there was a timestamp sleep
>    svntest.main.file_append(pi_path, 'zig\n')
>
> Index: svntest/main.py
>  ===================================================================
>  --- svntest/main.py     (revision 29877)
>  +++ svntest/main.py     (working copy)
>  @@ -638,6 +638,7 @@
>
>    dump_in, dump_out, dump_err, dump_kid = \
>             open_pipe(svnadmin_binary + dump_args, 'b')
>  +  dump_in.close()
>    load_in, load_out, load_err, load_kid = \
>             open_pipe(svnadmin_binary + load_args, 'b')
>    stop = time.time()
>  @@ -653,7 +654,6 @@
>
>    dump_lines = dump_err.readlines()
>    load_lines = load_out.readlines()
>  -  dump_in.close()
>    dump_out.close()
>    dump_err.close()
>    load_out.close()
>  @@ -1052,6 +1052,7 @@
>      # Tests that want to use an editor should invoke svntest.main.use_editor.
>      os.environ['SVN_EDITOR'] = ''
>      os.environ['SVNTEST_EDITOR_FUNC'] = ''
>  +    os.environ['SVN_CURRENT_TEST'] = os.path.basename(sys.argv[0]) + "_" + str(self.index)
>      actions.no_sleep_for_timestamps()
>
>      saved_dir = os.getcwd()
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: dev-help@subversion.tigris.org
>



-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org