Hi Marcus,

Thanks again for your time and help.  And always a pleasure to report
the difficulties I have with hope for help and guidance, which you
kindly provided.  Running ctest.exe by hand on the failing test cases
was the first step in debugging this problem.  As to your question
about things working, they sort of worked.  My original state with the
three failing tests was run with a copy of the gnuradio being built
already installed, or with the previous version of gnuradio installed,
I don't remember which now.  However, with a couple of hacks, I now
have a working test case environment for gnuradio, even when there is
not an already installed gnuradio instance.  And I am happy to report
that now when I run ctest.exe, either from a script or by hand all
test cases pass.  One thing I remember when I had an installed
instance of gnuradio, was running ctest.exe by hand vs running
ctest.exe from the build script.  By hand worked, the build script had
errors.  Still a mystery as to why.

I was confident enough in the test cases situation to submit a PR for
3.10.12.0, which was merged this morning.

All the best,

Chris

On Thu, Feb 27, 2025 at 9:03 AM Marcus Müller <mmuel...@gnuradio.org> wrote:
>
> Hey Chris,
> as said, very happy about you reporting this! Just to be sure: with the 
> version of GNU
> Radio that you're testing being the same as installed, things work, right? 
> (i.e., running
> the tests after `make install` or equivalent)
>
> On 2/26/25 3:55 PM, Chris Gorman wrote:
> > Hello again,
> >
> > Upon further investigation, I found that the only reason for the tests
> > running properly was that I had an installed copy of gnuradio, which
> > was providing the necessary dlls for the test run to succeed.  When I
> > removed the installed gnuradio, all the testcases failed. :(  It turns
> > out there were two problems.  The first was that none of the gnuradio
> > dlls were in the path when the test case was run.  The path in windows
> > provides the equivalent function of the LD_LIBRARY_PATH in linux, so
> > without the dlls in the path none of the programs built could load.
> > The second problem was that python will not load dlls from a path
> > other than the system python directory without a call to
> > os.add_dll_directory, passing it the directory containing the
> > gr_python .pyd library (the windows equivalent of the gr_python*.so
> > file).  I was able to hack together a find call to find all the test
> > cases and a sed regex to add the call to os.add_dll_directory to the
> > test cases.  Now they run properly even without an installed copy of
> > gnuradio. :)
> >
> > Thanks again to Marcus for his time on this.
> >
> > Best regards,
> >
> > Chris
> >
> > On Tue, Feb 25, 2025 at 1:14 PM Chris Gorman <chrisjohgor...@gmail.com> 
> > wrote:
> >>
> >> Hi Marcus,
> >>
> >> Thanks for your time.
> >>
> >> The output is as follows ...
> >>
> >> $ ctest.exe -R mute --output-on-failure
> >> Test project 
> >> C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/build-MINGW64
> >>      Start 72: qa_mute
> >> 1/1 Test #72: qa_mute ..........................   Passed    0.50 sec
> >>
> >> 100% tests passed, 0 tests failed out of 1
> >>
> >> Total Test time (real) =   0.64 sec
> >>
> >> $ ctest.exe -R interleaver --output-on-failure
> >> Test project 
> >> C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/build-MINGW64
> >>      Start  40: qa_blockinterleaver_xx
> >> 1/4 Test  #40: qa_blockinterleaver_xx ...........   Passed    0.80 sec
> >>      Start  62: qa_matrix_interleaver
> >> 2/4 Test  #62: qa_matrix_interleaver ............   Passed    0.43 sec
> >>      Start  77: qa_patterned_interleaver
> >> 3/4 Test  #77: qa_patterned_interleaver .........   Passed    0.41 sec
> >>      Start 241: qa_interleaver
> >> 4/4 Test #241: qa_interleaver ...................   Passed    0.36 sec
> >>
> >> 100% tests passed, 0 tests failed out of 4
> >>
> >> Total Test time (real) =   2.18 sec
> >>
> >> $ ctest.exe -R wavfile --output-on-failure
> >> Test project 
> >> C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/build-MINGW64
> >>      Start 112: qa_wavfile
> >> 1/1 Test #112: qa_wavfile .......................   Passed    0.82 sec
> >>
> >> 100% tests passed, 0 tests failed out of 1
> >>
> >> Total Test time (real) =   0.97 sec
> >>
> >> I can run all the tests by hand with ctest --output-on-failure and
> >> they all pass.  When I run them from the package build script, using
> >> the same command, I get the following errors.
> >>
> >> 72/268 Test  #72: qa_mute
> >> ......................................***Timeout  90.03 sec
> >> .thread_body_wrapper :error: ERROR thread[thread-per-block[1]: <block
> >> mute(7)>]: pmt_to_bool: wrong_type (() . #t)
> >>
> >> <---snip--->
> >>
> >> 112/268 Test #112: qa_wavfile
> >> ...................................***Failed    0.88 sec
> >> ...wavfile_sink :error: sf_open(1) failed: no_file.wav: Error : major
> >> format is 0.
> >> .Fss...
> >> ======================================================================
> >> FAIL: test_004_automatic_reopen_after_stop
> >> (__main__.test_wavefile.test_004_automatic_reopen_after_stop)
> >> ----------------------------------------------------------------------
> >> Traceback (most recent call last):
> >>    File 
> >> "C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/gnuradio-3.10.12.0/gr-blocks/python/blocks/qa_wavfile.py",
> >> line 203, in test_004_automatic_reopen_after_stop
> >>      self.assertEqual(out_params, expected_params)
> >> AssertionError: _wave[41 chars]te=8000, nframes=4, comptype='NONE',
> >> compname='not compressed') != _wave[41 chars]te=8000, nframes=8,
> >> comptype='NONE', compname='not compressed')
> >>
> >> ----------------------------------------------------------------------
> >> Ran 10 tests in 0.414s
> >>
> >> FAILED (failures=1, skipped=2)
> >>
> >> <---snip--->
> >>
> >> 241/268 Test #241: qa_interleaver
> >> ...............................***Failed    0.41 sec
> >> EEE
> >> ======================================================================
> >> ERROR: test_001_explicit_interleaver_vector_with_length
> >> (__main__.test_interleaver.test_001_explicit_interleaver_vector_with_length)
> >> ----------------------------------------------------------------------
> >> Traceback (most recent call last):
> >>    File 
> >> "C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/gnuradio-3.10.12.0/gr-trellis/python/trellis/qa_interleaver.py",
> >> line 29, in test_001_explicit_interleaver_vector_with_length
> >>      self.assertEqual((k, interl, de_in), (i.k(),
> >> i.interleaver_indices(), i.deinterleaver_indices()))
> >>                                            ^^^
> >> AttributeError: 'gnuradio.trellis.trellis_python.interleaver' object
> >> has no attribute 'k'
> >>
> >> ======================================================================
> >> ERROR: test_002_explicit_interleaver_vector
> >> (__main__.test_interleaver.test_002_explicit_interleaver_vector)
> >> ----------------------------------------------------------------------
> >> Traceback (most recent call last):
> >>    File 
> >> "C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/gnuradio-3.10.12.0/gr-trellis/python/trellis/qa_interleaver.py",
> >> line 34, in test_002_explicit_interleaver_vector
> >>      i = trellis.interleaver(interl)
> >>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >> TypeError: __init__(): incompatible constructor arguments. The
> >> following argument types are supported:
> >>      1. gnuradio.trellis.trellis_python.interleaver()
> >>      2. gnuradio.trellis.trellis_python.interleaver(INTERLEAVER:
> >> gnuradio.trellis.trellis_python.interleaver)
> >>      3. gnuradio.trellis.trellis_python.interleaver(K: int, INTER: 
> >> list[int])
> >>      4. gnuradio.trellis.trellis_python.interleaver(name: str)
> >>      5. gnuradio.trellis.trellis_python.interleaver(K: int, seed: int)
> >>
> >> Invoked with: [1, 2, 3, 4, 0]
> >>
> >> ======================================================================
> >> ERROR: test_002_random (__main__.test_interleaver.test_002_random)
> >> ----------------------------------------------------------------------
> >> Traceback (most recent call last):
> >>    File 
> >> "C:/msys64/home/chris/src/MINGW-packages/mingw-w64-gnuradio/src/gnuradio-3.10.12.0/gr-trellis/python/trellis/qa_interleaver.py",
> >> line 41, in test_002_random
> >>      self.assertSequenceEqual(sorted(i.interleaver_indices()), range(k))
> >>                                      ^^^^^^^^^^^^^^^^^^^^^
> >> AttributeError: 'gnuradio.trellis.trellis_python.interleaver' object
> >> has no attribute 'interleaver_indices'
> >>
> >> ----------------------------------------------------------------------
> >> Ran 3 tests in 0.006s
> >>
> >> FAILED (errors=3)
> >>
> >> Not sure what is causing this, given the success running ctest by
> >> hand, maybe there is something wrong with makepkg-mingw, the build
> >> program, running the tests.  Thanks for your suggestion Marcus, I feel
> >> much more comfortable updating the package.
> >>
> >> Best regards,
> >>
> >> Chris
> >>
> >> On Tue, Feb 25, 2025 at 11:35 AM Marcus Müller <mmuel...@gnuradio.org> 
> >> wrote:
> >>>
> >>> ah, just noticed: the `_test` at the end of the -R argument is wrong, 
> >>> please just `-R
> >>> wavfile` and `-R interleave`
> >>>
> >>> On 2/25/25 5:09 PM, Marcus Müller wrote:
> >>>> Hi Chris,
> >>>>
> >>>> I introduced that log message, because, well, we haven't implemented the 
> >>>> feature to set
> >>>> user thread names on Windows. That's always been the case, and hasn't 
> >>>> changed.
> >>>>
> >>>> Now, your three test case failures do worry me. Could you maybe attach 
> >>>> the outputs of
> >>>>
> >>>> ctest -R wavfile_test --output-on-failure
> >>>> ctest -R interleave_test --output-on-failure
> >>>>
> >>>> ?
> >>>>
> >>>> Thank you for reporting things like these,
> >>>> Marcus
> >>>>
> >>>> On 2/24/25 6:53 PM, Chris Gorman wrote:
> >>>>> Hello All,
> >>>>>
> >>>>> I'm in the process of updating the msys2 / mingw64 implementation of
> >>>>> gnuradio to 3.10.12.0 and have run into a problem with threading.  Two
> >>>>> tests fail[1] and one times out[2] while running the test suite.  When
> >>>>> run on their own, all three tests return 0 and appear to run properly,
> >>>>> but for a thread error.  I also get this error when running
> >>>>> gnuradio-companion.exe.  For each test case, and grc, I get multiple
> >>>>> lines of:
> >>>>>
> >>>>> "thread :error: function set_thread_name(gr_thread_t, string) not
> >>>>> implemented on this platform"
> >>>>>
> >>>>> My experience with threading is minimal and I feel uneasy proceeding
> >>>>> with the update, given the error.  If someone with more experience
> >>>>> could let me know their opinion on whether or not the thread error is
> >>>>> a cause for concern, I would appreciate it.
> >>>>>
> >>>>> Thanks in advance,
> >>>>>
> >>>>> Chris
> >>>>>
> >>>>> [1] qa_wavfile_test.bat and qa_interleave_test.bat
> >>>>> [2] qa_mute_test.bat
> >>>>>
> >>>>
> >>>
> >
>
>

Reply via email to