Skip to content

Probe: number sequence after a failed test, SCM test shapes (runner issue 8972) - #1572

Open
StefanMaron wants to merge 2 commits into
masterfrom
probe-failed-test-sequence-8972
Open

StefanMaron wants to merge 2 commits into
masterfrom
probe-failed-test-sequence-8972

Conversation

@StefanMaron

Copy link
Copy Markdown
Collaborator

This adds probe cells for AL Runner issue 8972: Microsoft SCM tests the runner refuses because a number sequence was inserted before a test failed. It extends the sequence probes of #1465 and #1468.

Files (app tests/al-language-isolation-probe, new id range 76440-76499):

  • SqFailedSeqFixture.al: tables, a card page, and a helper that makes the NumberSequence calls of Sequence No. Mgt. in the same order (own code).
  • SqFailedSeq.al: 33 cell codeunits (76450-76482). In each cell, test b fails on purpose (except the controls S1N, S1W, S2N) and test c asserts the readings in the same codeunit. There is no SingleInstance log, so AL Runner can confirm the readings (issue 8520).
  • nightly-windows.yml: runs the range under runners 130450, 61301 and 61300, plus a per-test results step.

Two groups:

  • S1: an earlier test inserted the sequence, and the failed test commits (Microsoft codeunits 137140, 137158, 137294). The failed test also uses a temporary Record, a TestPage, session builtins, a temporary RecordRef, RecordRef and FieldRef calls, a commit inside a called codeunit, and an insert whose table trigger calls IsolatedStorage (issue 8524).
  • S2: the failed test inserts the sequence before its own last commit (codeunit 137297).

What BC did (BC 29.0, runners 130450 and 61301, the same under both and on a second run):

  • A Commit() keeps a sequence only if a table was accessed since the previous commit. With only NumberSequence calls in between, the sequence is gone after a later failed test that accesses a table (S1R, S1S, S2F). Any Record or RecordRef read or write before that Commit() keeps it (S1T, S1U, S1V, S1X, S1Y). S1R gives the same result as the C2 cell of test: NumberSequence and manual bindings after a test that commits and fails #1465, which was measured on Windows.
  • NumberSequence.Next is not rolled back. A number the failed test took after its last commit stays used, and the entry inserted with it is gone.
  • The other access kinds in the failed test do not change the result.
  • A Commit() inside Codeunit.Run or inside a called method counts like a Commit() in the test.

How it was measured: only on my local BC 29.0 Linux container. The PR CI does not build or run this app, so a green PR run says nothing about these cells. BC 27.5, 28.5 and the Windows containers will be measured by the Windows nightly. I compiled the app against 27.5, 28.5 and 29.0 symbols with no errors. Gates pass: object ids, SingleInstance owners, install triggers.

Not measured: what a later test codeunit sees, and TestIsolation = Function (the nightly records it under 61300).

Generated by an AI agent (Claude) working for Stefan Maron.

https://claude.ai/code/session_01B5GPNVCdMf7ByZez1YeU96

27 cell codeunits (76450-76476) in the isolation probe app. Each cell
asserts its own readings in its test c. Measured on BC 29.0 under
runners 130450 and 61301, same readings under both. The Windows
nightly runs the range under 130450, 61301 and 61300.

AL Runner issue 8972.

Claude-Session: https://claude.ai/code/session_01B5GPNVCdMf7ByZez1YeU96
Six more cells (76477-76482): which accesses before a Commit() keep a
sequence after a later failed test, a TestPage control, and a failed
test with no table access after its Commit(). RecordRef.FieldIndex
added to the RecordRef calls.

Claude-Session: https://claude.ai/code/session_01B5GPNVCdMf7ByZez1YeU96
@StefanMaron

Copy link
Copy Markdown
Collaborator Author

Cell table. Each row: the cell codeunit, its shape, the test that asserts it (line at a29b1e4), and the reading on BC 29.0 under runners 130450 and 61301 (the same under both). Readings: name and preview = state of the sequence and of 'Preview' + name, read before the helper runs again; rows = keys of "LT SQF Row"; init desc = Description of the INIT row; entries = Entry Nos.; next = the number the helper hands out next.

Cell Shape Test c (file:line) BC 29.0 reading
S1A (76450) S1a: earlier test inserts and commits; failed test: Record write, Commit, Record write SqFailedSeq.al:85 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1N (76451) S1a control: the same test B does not fail SqFailedSeq.al:153 name=cur=1; preview=cur=-2000000001; rows=A,B1,B2,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1Z (76452) C2 shape with the helper (entry insert and Record write before the earlier Commit): failed test writes a Record, no commit SqFailedSeq.al:220 name=cur=1; preview=cur=-2000000001; rows=A,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1B (76453) S1b: S1a plus a temporary Record after the Commit SqFailedSeq.al:290 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1C (76454) S1c: S1a plus a TestPage after the Commit SqFailedSeq.al:360 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1D (76455) S1d: S1a plus a number from the helper after the Commit SqFailedSeq.al:446 name=cur=2; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=3; name after=cur=3
S1E (76456) S1e: S1a plus session builtins and a temporary RecordRef after the Commit SqFailedSeq.al:517 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1L (76457) S1a plus RecordRef and FieldRef calls on the real table after the Commit SqFailedSeq.al:587 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1F (76458) S1f: S1a plus every access kind of S1b-S1e and the RecordRef calls (the Microsoft shape) SqFailedSeq.al:662 name=cur=2; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=3; name after=cur=3
S1G (76459) S1g: S1f with no Commit in the failed test SqFailedSeq.al:752 name=cur=2; preview=cur=-2000000001; rows=A,INIT; init desc=''; entries=1; next=3; name after=cur=3
S1H (76460) S1h: S1f with the Commit inside Codeunit.Run of a posting codeunit SqFailedSeq.al:843 name=cur=2; preview=cur=-2000000001; rows=A,B1,INIT,POST; init desc=''; entries=1; next=3; name after=cur=3
S1P (76461) S1h with the Commit inside a method call of a posting codeunit SqFailedSeq.al:935 name=cur=2; preview=cur=-2000000001; rows=A,B1,INIT,POST; init desc=''; entries=1; next=3; name after=cur=3
S1I (76462) S1i: earlier test inserts with no commit; a later passing test commits; failed test as S1f SqFailedSeq.al:1034 name=cur=2; preview=cur=-2000000001; rows=A,A2,B1,INIT; init desc=''; entries=1; next=3; name after=cur=3
S1J (76463) earlier test inserts with no commit; failed test: Record write, Commit, Record write SqFailedSeq.al:1118 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1K (76464) earlier test inserts with no commit; failed test as S1f SqFailedSeq.al:1192 name=cur=2; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=3; name after=cur=3
S1M (76465) issue 8524 (C2 shape): failed test inserts a row whose insert trigger calls IsolatedStorage, no commit SqFailedSeq.al:1275 name=cur=1; preview=cur=-2000000001; rows=A,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1Q (76466) issue 8524 shape with a Commit before the trigger insert SqFailedSeq.al:1344 name=cur=1; preview=cur=-2000000001; rows=A,B1,INIT; init desc=''; entries=1; next=2; name after=cur=2
S1R (76467) C2 replica: earlier test inserts a sequence (no CompanyWide), takes a number, commits with no table write; failed test writes a Record, no commit SqFailedSeq.al:1411 name=missing; preview=missing; rows=INIT; init desc=''; entries=none; next=1; name after=cur=1
S1S (76468) S1R with NumberSequence.Insert(..., true) SqFailedSeq.al:1478 name=missing; preview=missing; rows=INIT; init desc=''; entries=none; next=1; name after=cur=1
S1T (76469) S1R with a Record write before the Commit of the earlier test SqFailedSeq.al:1546 name=cur=1; preview=missing; rows=A,INIT; init desc=''; entries=none; next=2; name after=cur=2
S2A (76470) S2a: failed test: helper inserts the sequence and an entry, Commit, Record write SqFailedSeq.al:1612 name=cur=1; preview=cur=-2000000001; rows=INIT; init desc=''; entries=1; next=2; name after=cur=2
S2B (76471) S2b: S2a plus every access kind of S1f after the Commit SqFailedSeq.al:1684 name=cur=2; preview=cur=-2000000001; rows=INIT; init desc=''; entries=1; next=3; name after=cur=3
S2N (76472) S2b control: the same test B does not fail SqFailedSeq.al:1771 name=cur=2; preview=cur=-2000000001; rows=B2,INIT; init desc='REF'; entries=1,2; next=3; name after=cur=3
S2C (76473) S2c: S2b with the Commit inside Codeunit.Run of a posting codeunit SqFailedSeq.al:1859 name=cur=2; preview=cur=-2000000001; rows=INIT,POST; init desc=''; entries=1; next=3; name after=cur=3
S2D (76474) S2d: S2b with a Commit before the insert too SqFailedSeq.al:1949 name=cur=2; preview=cur=-2000000001; rows=B0,INIT; init desc=''; entries=1; next=3; name after=cur=3
S2E (76475) failed test: Commit, then the helper inserts the sequence and an entry (no commit after the insert) SqFailedSeq.al:2031 name=missing; preview=missing; rows=INIT; init desc=''; entries=none; next=1; name after=cur=1
S2F (76476) failed test: NumberSequence.Insert and Next with no table write, Commit, Record write SqFailedSeq.al:2098 name=missing; preview=missing; rows=INIT; init desc=''; entries=none; next=1; name after=cur=1
S1U (76477) S1R with a Record write before the sequence insert (no write after it) in the earlier test SqFailedSeq.al:2166 name=cur=1; preview=missing; rows=A,INIT; init desc=''; entries=none; next=2; name after=cur=2
S1V (76478) earlier test: the helper hands out a number with no entry insert, Commit; failed test writes a Record, no commit SqFailedSeq.al:2232 name=cur=1; preview=cur=-2000000001; rows=INIT; init desc=''; entries=none; next=2; name after=cur=2
S1W (76479) S1c control: the same test B does not fail SqFailedSeq.al:2301 name=cur=1; preview=cur=-2000000001; rows=A,B1,B2,INIT; init desc='PAGE'; entries=1; next=2; name after=cur=2
S2G (76480) failed test: NumberSequence.Insert and Next with no table write, Commit, no table access after it SqFailedSeq.al:2383 name=cur=1; preview=missing; rows=INIT; init desc=''; entries=none; next=2; name after=cur=2
S1X (76481) S1R with a Record read (no lock) before the Commit of the earlier test SqFailedSeq.al:2451 name=cur=1; preview=missing; rows=INIT; init desc=''; entries=none; next=2; name after=cur=2
S1Y (76482) S1R with a Record read under ReadIsolation UpdLock before the Commit of the earlier test SqFailedSeq.al:2519 name=cur=1; preview=missing; rows=INIT; init desc=''; entries=none; next=2; name after=cur=2

Generated by an AI agent (Claude) working for Stefan Maron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant