Ticket #1249 (closed cage: fixed)

Opened 5 years ago

Last modified 5 years ago

t/pmc/threads.t: Thread types tests need rework

Reported by: jkeenan Owned by:
Priority: trivial Milestone:
Component: testing Version: 1.7.0
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform:

Description

This ticket moves to Trac discussion originally found in  RT #46807.

In that ticket, Paul Cochrane reported a TODO comment found in t/pmc/threads.t:

rework tests since we don't really have thread types?

I later commented that I didn't know what that meant, and that's where discussion lapsed twelve months ago.

So, can anyone tell us: Do we really have thread types?

Change History

  Changed 5 years ago by jkeenan

Here is current prove -v output:

not ok 10 - CLONE_CODE | CLONE_CLASSES; superclass not built-in # TODO vtable overrides aren't properly cloned TT # 1248

#   Failed (TODO) test 'CLONE_CODE | CLONE_CLASSES; superclass not built-in'
#   at t/pmc/threads.t line 454.
#          got: 'in thread:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 0
# Foo? 0
# Bar? 1
# in main:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 0
# Foo? 1
# Bar? 1
# '
#     expected: 'in thread:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 0
# Foo? 1
# Bar? 1
# in main:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 0
# Foo? 1
# Bar? 1
# '
not ok 11 - CLONE_CODE | CLONE_CLASSES; superclass built-in # TODO likely incorrect test TT 1248

#   Failed (TODO) test 'CLONE_CODE | CLONE_CLASSES; superclass built-in'
#   at t/pmc/threads.t line 539.
#          got: 'in thread:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 1
# Foo? 0
# Bar? 1
# in main:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 1
# Foo? 1
# Bar? 1
# '
#     expected: 'in thread:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 1
# Foo? 1
# Bar? 1
# in main:
# A Bar
# called Bar's barmeth
# called Foo's foometh
# Integer? 1
# Foo? 1
# Bar? 1
# '

follow-up: ↓ 3   Changed 5 years ago by Infinoid

The TODO comment was added in r14131, and it refers to a couple of tests (directly below the comment) named "thread type 1" and "thread type 2".

When the tests were added (in r4993), the only apparent difference between the two "types" was whether the thread function took any arguments or not. The first test didn't pass an argument; the second test did. Today, that remains the only difference. (The two tests have since grown into 3, but the distinction is still the same.) So it seems safe to assume that's what was referred to by "thread type".

Since that's still a valid distinction, it seems reasonable to keep testing both cases. So, I don't think any refactoring of the tests is required.

in reply to: ↑ 2   Changed 5 years ago by jkeenan

  • status changed from new to closed
  • priority changed from normal to trivial
  • resolution set to fixed
  • patch set to applied

Replying to Infinoid:

Since that's still a valid distinction, it seems reasonable to keep testing both cases. So, I don't think any refactoring of the tests is required.

I'll take that as authorization to delete the mysterious comment and close the ticket.

Done in r45260. Thank you very much.

kid51

Note: See TracTickets for help on using tickets.